paref.pareto_reflection_sequences.generic.next_when_stopping_criteria_met#
Classes
Define a sequence by moving on to the next Pareto reflection if convergence is reached |
- class paref.pareto_reflection_sequences.generic.next_when_stopping_criteria_met.NextWhenStoppingCriteriaMet(pareto_reflections: List[ParetoReflection], stopping_criteria: StoppingCriteria)[source]#
Bases:
SequenceParetoReflectionsDefine a sequence by moving on to the next Pareto reflection if convergence is reached
When to use#
This sequence should be used if you want to repeat a single Pareto reflection until the Pareto point it is looking for is sufficiently close approximated (to be specified in a stopping criteria).
What it does#
The sequence simply loops through given Pareto reflections until a defined stopping criteria is met. If the end is reached, this sequence returns None, indicating the end of the sequence.
Examples
# TBA: add Initialize list of Pareto reflections
>>> import numpy as np >>> from paref.pareto_reflections.restrict_by_point import RestrictByPoint >>> from paref.pareto_reflection_sequences.generic.repeating_sequence import RepeatingSequence >>> from paref.moo_algorithms.stopping_criteria.max_iterations_reached import MaxIterationsReached
Initialze stopping criteria
>>> stopping_criteria = MaxIterationsReached(max_iterations=1)
Initialize Pareto reflection to be repeated
>>> pareto_reflecting_functions = [RestrictByPoint(nadir=np.ones(1),restricting_point=np.ones(1))]
Initialize repeating sequence
>>> sequence = RepeatingSequence(pareto_reflections=pareto_reflecting_functions)
The repeating sequence returns the given Pareto reflection in each step of iteration until the stopping criteria is met
>>> sequence.next().__class__.__name__ RestrictByPoint
>>> sequence.next() None
Specify the stopping criteria and the Pareto reflections to be repeated
- param stopping_criteria:
stopping criteria indicating when to move to the next Pareto reflection
- type stopping_criteria:
StoppingCriteria
- param pareto_reflections:
Pareto reflections stored in a list
- type pareto_reflections:
List[ParetoReflection]
- next(blackbox_function: BlackboxFunction) ParetoReflection | None[source]#
Return the next Pareto reflection of the sequence if stopping criteria is met
- Returns:
next Pareto reflection of the list or same Pareto reflection as before if stopping criteria is not met
- Return type: