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(**kwargs)[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
Initialize storage for Pareto reflections
- next(**kwargs)#
Store Pareto reflections