uo.tests.unit.algorithm.metaheuristic package

Subpackages

Submodules

uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control module

class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control.TestAddToAllSolutionCodesIfRequired(methodName='runTest')

Bases: TestCase

test_all_solution_codes_empty2()
test_all_solution_codes_not_set()
test_keep_all_solution_codes_false()
test_keep_all_solution_codes_true()
test_representation_already_in_all_solution_codes()
test_representation_not_string()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control.TestAddToMoreLocalOptimaIfRequired(methodName='runTest')

Bases: TestCase

test_add_to_more_local_optima_empty_structure()
test_add_to_more_local_optima_full_structure_new_solution_better()
test_add_to_more_local_optima_keep_more_local_optima_false()
test_add_to_more_local_optima_keep_more_local_optima_false2()
test_add_to_more_local_optima_not_full_structure()
test_add_to_more_local_optima_solution_to_add_rep_not_string()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control.TestAdditionalStatisticsControl(methodName='runTest')

Bases: TestCase

test_add_to_all_solution_codes_if_required()
test_add_to_more_local_optima_existing_solution()
test_add_to_more_local_optima_new_solution()
test_invalid_keep_parameter_type()
test_invalid_keep_property_value()
test_invalid_max_local_optima_parameter_type()
test_valid_keep_property_update()
test_valid_parameters_initialization()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control.TestMaxLocalOptima(methodName='runTest')

Bases: TestCase

test_max_local_optima_can_be_zero()
test_max_local_optima_can_not_be_negative()
test_raises_type_error_if_max_local_optima_not_integer()
test_returns_integer_value()
test_returns_max_local_optima_value2()
test_returns_maximum_number_of_local_optima()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control.Test__DetermineKeepHelper__(methodName='runTest')

Bases: TestCase

test_determine_keep_helper_criteria_checked()
test_determine_keep_helper_flags_default()
test_determine_keep_helper_invalid_value()
test_determine_keep_helper_keep_not_string()
test_determine_keep_helper_max_local_optima_not_integer()
test_determine_keep_helper_parse_keep_parameter3()

uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2 module

class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestAddToAllSolutionCodesIfRequired(methodName='runTest')

Bases: TestCase

test_all_solution_codes_not_set()
test_keep_all_solution_codes_false()
test_keep_all_solution_codes_not_boolean()
test_keep_all_solution_codes_true()
test_representation_already_in_all_solution_codes()
test_representation_empty_string()
test_representation_non_empty_string()
test_representation_not_string()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestAddToMoreLocalOptimaIfRequired(methodName='runTest')

Bases: TestCase

test_add_new_solution_to_local_optima_structure()
test_raise_type_error_if_best_solution_rep_not_string()
test_raise_type_error_if_solution_to_add_fitness_not_int_float_list()
test_raise_type_error_if_solution_to_add_rep_not_string()
test_remove_random_local_optima_when_max_reached()
test_return_true_when_new_solution_added()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestAllSolutionCodes(methodName='runTest')

Bases: TestCase

test_set_all_solution_codes_with_non_set_value()
test_set_all_solution_codes_with_none_value()
test_set_duplicate_solution_codes()
test_set_empty_solution_codes()
test_set_non_empty_solution_codes()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestKeepAllSolutionCodes(methodName='runTest')

Bases: TestCase

test_raises_attribute_error_if_keep_all_solution_codes_property_is_not_boolean()
test_raises_type_error_if_representation_parameter_is_not_string()
test_returns_boolean_indicating_if_all_solution_codes_should_be_kept()
test_returns_true_if_all_solution_codes_should_be_kept()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestKeepMoreLocalOptima(methodName='runTest')

Bases: TestCase

test_raises_type_error_if_best_solution_rep_is_not_a_string()
test_raises_type_error_if_solution_to_add_fitness_is_not_a_float_or_float_list()
test_raises_type_error_if_solution_to_add_rep_is_not_a_string()
test_returns_false_if_keep_more_local_optima_is_false()
test_returns_false_if_solution_to_add_rep_is_already_in_more_local_optima()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestMaxLocalOptima(methodName='runTest')

Bases: TestCase

test_raises_type_error_when_max_local_optima_not_integer()
test_returns_integer_value()
test_returns_max_local_optima_value()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.TestMoreLocalOptima(methodName='runTest')

Bases: TestCase

test_max_local_optima_elements_removes_oldest_element()
test_none_input_updates_attribute()
test_valid_input_updates_attribute()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.Test__Init_22(methodName='runTest')

Bases: TestCase

test_default_values()
test_empty_string_keep()
test_invalid_keep()
test_keep_all_solution_code_and_more_local_optima()
test_keep_more_local_optima()
test_keep_not_string()
test_large_value_for_max_local_optima()
test_max_local_optima_less_than_zero()
test_max_local_optima_not_integer()
test_max_local_optima_zero()
test_maximum_max_local_optima_count()
test_minimum_max_local_optima_count()
test_multiple_valid_keep()
test_small_value_for_max_local_optima()
test_valid_and_invalid_values_for_keep()
test_valid_input_values()
test_valid_string_keep()
test_whitespace_keep()
class uo.tests.unit.algorithm.metaheuristic.test_additional_statistics_control_2.Test__Str__P1(methodName='runTest')

Bases: TestCase

test_contain_relevant_keep_property_when_keep_is_blank()
test_contains_keep_and_use_cache_properties()
test_returns_string_representation()

uo.tests.unit.algorithm.metaheuristic.test_finish_control module

class uo.tests.unit.algorithm.metaheuristic.test_finish_control.TestFinishControl(methodName='runTest')

Bases: TestCase

test_change_criteria()
test_copy()
test_copy_instance()
test_duplicate_criteria()
test_invalid_criteria()
test_invalid_parameters()
test_is_finished_outside_criteria()
test_is_finished_within_criteria()
test_no_criteria_specified()
test_single_criteria()
test_string_representation()
test_valid_parameters()

uo.tests.unit.algorithm.metaheuristic.test_metaheuristic module

class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestAdditionalStatisticsControl(methodName='runTest')

Bases: TestCase

test_returns_additional_statistics_control()
test_returns_instance_of_additional_statistics_control()
test_returns_same_instance_as_passed_in_constructor()
test_returns_unmodified_instance2()
class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestFinishControl(methodName='runTest')

Bases: TestCase

test_raises_type_error_if_finish_control_not_of_type_finish_control()
test_returns_finish_control_structure()
test_returns_identical_finish_control()
test_returns_same_instance_of_finish_control()
class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestMainLoopIteration(methodName='runTest')

Bases: TestCase

test_executes_one_iteration()
test_finish_control_indicates_algorithm_finished()
class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestMetaheuristic2(methodName='runTest')

Bases: TestCase

test_copy_method()
test_elapsed_seconds_method()
test_invalid_additional_statistics_control()
test_invalid_finish_control_parameter()
test_invalid_name_parameter()
test_invalid_output_control()
test_invalid_problem_parameter()
test_invalid_random_seed()
test_main_loop_finished()
test_main_loop_method()
test_optimize_method()
test_optimize_random_seed()
test_string_rep_method()
class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestMetaheuristicProperties(methodName='runTest')

Bases: TestCase

setUp()

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()

Hook method for setting up class fixture before running tests in the class.

tearDown()

Hook method for deconstructing the test fixture after testing it.

classmethod tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_evaluations_max_should_be_equal_as_in_constructor()
test_iterations_max_should_be_equal_as_in_constructor()
test_name_should_be_equal_as_in_constructor()
test_problem_is_minimization_should_be_equal_as_in_constructor()
test_problem_name_should_be_equal_as_in_constructor()
test_random_seed_should_be_equal_as_in_constructor()
test_seconds_max_should_be_equal_as_in_constructor()
class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestRandomSeed(methodName='runTest')

Bases: TestCase

test_raises_no_errors_when_random_seed_is_zero()
test_raises_type_error_when_random_seed_not_integer_or_none()
test_returns_correct_random_seed_value()
test_returns_random_seed()
class uo.tests.unit.algorithm.metaheuristic.test_metaheuristic.TestStringRep(methodName='runTest')

Bases: TestCase

test_empty_delimiter()
test_returns_string_representation()
test_uses_formatting_parameters()

uo.tests.unit.algorithm.metaheuristic.test_single_solution_metaheuristic module

class uo.tests.unit.algorithm.metaheuristic.test_single_solution_metaheuristic.TestCurrentSolution(methodName='runTest')

Bases: TestCase

test_create_with_invalid_current_solution_raises_type_error()
test_create_with_invalid_current_solution_raises_type_error2()
test_get_current_solution_returns_value()
test_set_solution_template_to_not_Target_solution()
class uo.tests.unit.algorithm.metaheuristic.test_single_solution_metaheuristic.TestSingleSolutionMetaheuristic(methodName='runTest')

Bases: TestCase

test_copy()
test_different_solution_types()
test_formatted_representation()
test_invalid_parameters_initialization()
test_set_invalid_current_solution()
test_solution_template_not_solution()
test_string_representation()
test_valid_parameters_initialization()
class uo.tests.unit.algorithm.metaheuristic.test_single_solution_metaheuristic.Test__Str__2(methodName='runTest')

Bases: TestCase

test_include_current_solution_representation()
test_include_metaheuristic_representation()
test_raise_typeerror_if_solution_template_is_not_solution()
test_return_string_representation()

Module contents