← Về thư mục
tests/pymoo/test_scripts.py
- is_non_dominated · function · L71-L74 — def is_non_dominated(front: "np.ndarray") -> bool
- BiObjectiveProblemDefinitionTests · class · L77-L103 — class BiObjectiveProblemDefinitionTests(unittest.TestCase)
- setUp · method · L78-L79 — def setUp(self) -> None
- test_the_declared_shape_matches_the_docstring · method · L81-L86 — def test_the_declared_shape_matches_the_docstring(self) -> None
- test_the_objectives_are_the_two_squared_distances · method · L88-L96 — def test_the_objectives_are_the_two_squared_distances(self) -> None: # f1 = |x|^2 and f2 = |x - (1, 1)|^2, so the corners are exact.
- test_the_two_objectives_genuinely_conflict · method · L98-L103 — def test_the_two_objectives_genuinely_conflict(self) -> None: # The origin minimises f1 and (1, 1) minimises f2; if one point were # best at both there would be nothing to trade off.
- ConstrainedProblemDefinitionTests · class · L106-L144 — class ConstrainedProblemDefinitionTests(unittest.TestCase)
- setUp · method · L107-L108 — def setUp(self) -> None
- test_two_inequality_constraints_are_declared_over_the_stated_box · method · L110-L113 — def test_two_inequality_constraints_are_declared_over_the_stated_box(self) -> None
- test_a_feasible_point_evaluates_to_non_positive_constraints · method · L115-L123 — def test_a_feasible_point_evaluates_to_non_positive_constraints(self) -> None: # At (1.0, 0.0): f = (1, (1+0)/1) = (1, 1); g1 = -(0 + 9 - 6) = -3 and # g2 = -(-0 + 9 - 1) = -8, so both original inequalities hold.
- test_a_point_violating_both_constraints_is_reported_infeasible · method · L125-L132 — def test_a_point_violating_both_constraints_is_reported_infeasible(self) -> None: # At (0.1, 0.0): g1 = -(0 + 0.9 - 6) = 5.1 and g2 = -(-0 + 0.9 - 1) = 0.1, # both positive, so the sign conversion in the docstring is the real one.
- test_the_search_returns_only_feasible_solutions · method · L134-L144 — def test_the_search_returns_only_feasible_solutions(self) -> None
- SingleObjectiveExampleTests · class · L147-L178 — class SingleObjectiveExampleTests(unittest.TestCase)
- test_pymoos_sphere_has_its_optimum_at_one_half · method · L148-L156 — def test_pymoos_sphere_has_its_optimum_at_one_half(self) -> None: # pymoo's Sphere is sum (x_i - 0.5)^2 on [0, 1]^n: zero at 0.5 and # n * 0.25 at the origin. The GA below is judged against that.
- test_a_short_genetic_algorithm_run_approaches_the_known_optimum · method · L158-L162 — def test_a_short_genetic_algorithm_run_approaches_the_known_optimum(self) -> None
- test_the_example_reports_the_evaluation_budget_it_used · method · L164-L169 — def test_the_example_reports_the_evaluation_budget_it_used(self) -> None: # pop_size * n_gen evaluations, which is what the example prints.
- test_the_same_seed_gives_the_same_answer · method · L171-L178 — def test_the_same_seed_gives_the_same_answer(self) -> None
- MultiObjectiveExampleTests · class · L181-L207 — class MultiObjectiveExampleTests(unittest.TestCase)
- test_zdt1_is_the_thirty_variable_bi_objective_benchmark · method · L182-L184 — def test_zdt1_is_the_thirty_variable_bi_objective_benchmark(self) -> None
- test_the_analytic_front_satisfies_f2_equals_one_minus_root_f1 · method · L186-L190 — def test_the_analytic_front_satisfies_f2_equals_one_minus_root_f1(self) -> None: # ZDT1's true front is a published closed form; the example plots it as # the reference curve, so it must be the real one.
- test_an_nsga2_run_returns_a_mutually_non_dominated_set · method · L192-L199 — def test_an_nsga2_run_returns_a_mutually_non_dominated_set(self) -> None
- test_no_solution_can_beat_the_analytic_front · method · L201-L207 — def test_no_solution_can_beat_the_analytic_front(self) -> None: # Nothing feasible lies below f2 = 1 - sqrt(f1); a result that did would # mean the problem or the front is wrong.
- ManyObjectiveExampleTests · class · L210-L252 — class ManyObjectiveExampleTests(unittest.TestCase)
- test_das_dennis_directions_take_the_dimension_positionally · method · L211-L220 — def test_das_dennis_directions_take_the_dimension_positionally(self) -> None: # The regression this guards: get_reference_directions("das-dennis", # n_obj=5, ...) raises TypeError because the factory's first argument is # n_dim, which made the many-objective example unrunnable.
- test_more_partitions_give_more_directions · method · L222-L228 — def test_more_partitions_give_more_directions(self) -> None
- test_every_feasible_dtlz2_point_lies_on_or_outside_the_unit_sphere · method · L230-L238 — def test_every_feasible_dtlz2_point_lies_on_or_outside_the_unit_sphere(self) -> None: # DTLZ2 scales the unit sphere by 1 + g with g >= 0, so ||f|| >= 1 with # equality exactly on the Pareto front.
- test_nsga3_optimises_a_three_objective_problem_towards_the_sphere · method · L240-L252 — def test_nsga3_optimises_a_three_objective_problem_towards_the_sphere(self) -> None
- PseudoWeightDecisionTests · class · L255-L271 — class PseudoWeightDecisionTests(unittest.TestCase)
- setUp · method · L258-L264 — def setUp(self) -> None
- test_weighting_one_objective_selects_the_best_point_in_it · method · L266-L268 — def test_weighting_one_objective_selects_the_best_point_in_it(self) -> None
- test_equal_weights_select_the_balanced_compromise · method · L270-L271 — def test_equal_weights_select_the_balanced_compromise(self) -> None
- DecisionMakingExampleTests · class · L274-L305 — class DecisionMakingExampleTests(unittest.TestCase)
- setUpClass · method · L276-L279 — def setUpClass(cls) -> None
- test_the_selection_indexes_into_both_result_arrays_consistently · method · L281-L286 — def test_the_selection_indexes_into_both_result_arrays_consistently(self) -> None
- test_shifting_the_weights_moves_the_choice_along_the_front · method · L288-L298 — def test_shifting_the_weights_moves_the_choice_along_the_front(self) -> None
- test_the_extreme_solutions_are_the_per_objective_minima · method · L300-L305 — def test_the_extreme_solutions_are_the_per_objective_minima(self) -> None