opt.tests.unit.single_objective.comb.ones_count_max_problem package

Submodules

opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem module

class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem.TestFromDimension(methodName='runTest')

Bases: TestCase

test_correct_dimension_value()
test_create_instance_with_dimension()
test_raises_type_error_if_dimension_not_integer()
test_raises_value_error_if_dimension_less_than_or_equal_to_zero()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem.TestMaxOnesCountProblem(methodName='runTest')

Bases: TestCase

test_copy_creates_new_instance_with_same_properties()
test_copy_creates_new_instance_with_same_properties_but_not_same_object()
test_from_dimension_creates_new_instance_with_specified_dimension()
test_instantiation_from_input_file_with_missing_dimension_value_raises_value_error()
test_instantiation_from_input_file_with_specified_format()
test_instantiation_from_input_file_with_unsupported_format_raises_value_error()
test_instantiation_with_negative_dimension_raises_value_error()
test_instantiation_with_non_integer_dimension_raises_type_error()
test_instantiation_with_zero_dimension_raises_value_error()
test_instantiation_without_dimension_parameter()
test_new_instance_with_dimension_sets_dimension_property()
test_string_representation_includes_dimension_property()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem.Test__LoadFromFile__(methodName='runTest')

Bases: TestCase

test_raise_value_error_if_data_format_not_txt()
test_raise_value_error_if_loading_from_file_produces_invalid_dimension()
test_read_dimension_from_txt_file()
test_return_dimension_as_integer()

opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution module

class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestArgument(methodName='runTest')

Bases: TestCase

test_returns_binary_string_representation()
test_returns_empty_string_for_empty_representation()
test_returns_string_representation()
test_returns_string_representation_with_leading_zeros_for_all_false_bits()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestCalculateQualityDirectly(methodName='runTest')

Bases: TestCase

test_all_bits_set_to_0()
test_all_bits_set_to_1()
test_bitarray_length_0()
test_non_bitarray_representation()
test_none_representation()
test_random_bit_string()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestInitFrom(methodName='runTest')

Bases: TestCase

test_raises_type_error_for_invalid_representation()
test_sets_internal_representation()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestInitRandom(methodName='runTest')

Bases: TestCase

test_initializes_solution_with_correct_dimension()
test_initializes_solution_with_dimension_0()
test_initializes_solution_with_negative_dimension()
test_sets_elements_to_true_or_false_with_probability_50_percent()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestMaxOnesCountProblemBitArraySolution(methodName='runTest')

Bases: TestCase

test_argument_method_returns_correct_string_representation()
test_calculate_quality_directly_method_with_all_bits_false()
test_calculate_quality_directly_method_with_all_bits_true()
test_calculate_quality_directly_method_with_bitarray_and_problem()
test_copy_method_returns_deep_copy()
test_init_from_method_with_bitarray_and_problem()
test_init_random_method_with_problem()
test_initialize_instance_with_default_parameters()
test_native_representation_method_with_string_representation()
test_representation_distance_directly_method_with_string_representations()
test_representation_distance_directly_raises_value_error()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestNativeRepresentation(methodName='runTest')

Bases: TestCase

test_invalid_characters_representation()
test_length_1_representation()
test_non_string_representation()
test_same_binary_representation()
test_valid_binary_string_representation()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestRepresentationDistanceDirectly(methodName='runTest')

Bases: TestCase

test_completely_different_solutions()
test_different_lengths()
test_different_types()
test_empty_solutions()
test_identical_solutions()
test_one_different_bit()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution.TestStringRep(methodName='runTest')

Bases: TestCase

test_default_values()
test_delimiter_is_none()
test_group_start_is_none()
test_includes_string_representation()
test_includes_super_class_representation()
test_indentation_is_none()
test_optional_parameters()
test_returns_string_representation()

opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution_te_support module

class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution_te_support.TestTeOperationsSupportBitArray(methodName='runTest')

Bases: TestCase

test_can_progress()
test_progress_internal_counter_and_state()
test_reset_internal_counter_and_state()

opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution_vns_support module

class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_bit_array_solution_vns_support.TestMaxOnesCountProblemBitArraySolutionVnsSupport(methodName='runTest')

Bases: TestCase

test_local_search_best_improvement_returns_solution_with_higher_fitness_value11()
test_local_search_best_improvement_returns_solution_with_higher_fitness_value6()
test_local_search_first_improvement_returns_solution_with_higher_fitness_value10()
test_local_search_first_improvement_returns_solution_with_higher_fitness_value4()
test_shaking_modifies_solution_representation_when_number_of_ones_is_less_than_problem_dimension8()
test_shaking_returns_true_when_randomization_is_successful()

opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_int_solution module

class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_int_solution.TestMaxOnesCountProblemIntSolution(methodName='runTest')

Bases: TestCase

test_calculate_quality_directly()
test_create_new_instance_with_custom_parameters()
test_create_new_instance_with_default_parameters()
test_create_new_instance_with_large_dimension()
test_create_new_instance_with_negative_random_seed()
test_create_new_instance_with_zero_dimension()
test_initialize_solution_from_representation()
test_initialize_solution_randomly()
test_initialize_solution_randomly_with_none_dimension()
test_obtain_native_representation_from_string_representation()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_int_solution.TestNativeRepresentation(methodName='runTest')

Bases: TestCase

test_obtain_int_representation()
test_string_representation_contains_binary_digits()
test_string_representation_is_double_zero()
test_string_representation_is_one()
test_string_representation_is_zero()
test_string_representation_not_empty()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_int_solution.TestRepresentationDistanceDirectly(methodName='runTest')

Bases: TestCase

test_different_lengths()
test_different_solutions()
test_identical_solutions()
test_non_binary_characters()
test_one_bit_difference()
class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_binary_int_solution.TestStringRep(methodName='runTest')

Bases: TestCase

test_includes_native_representation()
test_includes_superclass_representation()

opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_ilp_linopy module

class opt.tests.unit.single_objective.comb.ones_count_max_problem.test_ones_count_problem_ilp_linopy.TestMaxOnesCountProblemIntegerLinearProgrammingSolverConstructionParameters(methodName='runTest')

Bases: TestCase

test_default_parameters_no_exceptions()
test_invalid_output_control_type()
test_invalid_problem_type()
test_valid_parameters_no_exceptions()

Module contents