pymoo API Reference
Multi-objective optimization framework in Python providing state-of-the-art algorithms (NSGA-II, MOEA/D, etc.).
pymoo.core.problem.Cache
Python Library Documentation: function Cache in module pymoo.util.cache
Cache(func)
Decorator that caches the first function call result.
This is a function decorator for class attributes. It remembers the result
of the FIRST function call and returns it from there on. Other caches like
LRU are difficult to use because the input can be unhashable or contain
larger numpy arrays. Thus the user has to choose how to use this cache.
pymoo.core.problem.ElementwiseEvaluationFunction
Python Library Documentation: class ElementwiseEvaluationFunction in module pymoo.core.problem class ElementwiseEvaluationFunction(builtins.object) | ElementwiseEvaluationFunction(problem, args, kwargs) -> 'None' | | Methods defined here: | | __call__(self, x) | Call self as a function. | | __init__(self, problem, args, kwargs) -> 'None' | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.core.problem.ElementwiseProblem
Python Library Documentation: class ElementwiseProblem in module pymoo.core.problem class ElementwiseProblem(Problem) | ElementwiseProblem(elementwise=True, **kwargs) | | Method resolution order: | ElementwiseProblem | Problem | builtins.object | | Methods defined here: | | __init__(self, elementwise=True, **kwargs) | Initialize a Problem. | | Args: | n_var: Number of variables. | n_obj: Number of objectives. | n_ieq_constr: Number of inequality constraints. | n_eq_constr: Number of equality constraints. | xl: Lower bounds for variables (float/int/array). | xu: Upper bounds for variables (float/int/array). | vtype: Variable type hint. | vars: Variables in explicit form. | elementwise: Whether to use elementwise evaluation. | elementwise_func: Function for elementwise evaluation. | elementwise_runner: Runner for elementwise evaluation. | requires_kwargs: Whether evaluation requires kwargs. | replace_nan_values_by: Value to replace NaN with. | exclude_from_serialization: Attributes to exclude from serialization. | callback: Callback function after each evaluation. | strict: Whether to check shapes strictly. | **kwargs: Additional keyword arguments. | | ---------------------------------------------------------------------- | Methods inherited from Problem: | | __getstate__(self) | Helper for pickle. | | __str__(self) | Return str(self). | | bounds(self) | | do(self, X, return_values_of, *args, **kwargs) | | evaluate(self, X, *args, return_values_of=None, return_as_dictionary=False, **kwargs) | | has_bounds(self) | | has_constraints(self) | | ideal_point = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | nadir_point = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | name(self) | | pareto_front = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | pareto_set = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | ---------------------------------------------------------------------- | Readonly properties inherited from Problem: | | n_constr | | ---------------------------------------------------------------------- | Data descriptors inherited from Problem: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.core.problem.LoopedElementwiseEvaluation
Python Library Documentation: class LoopedElementwiseEvaluation in module pymoo.core.problem class LoopedElementwiseEvaluation(builtins.object) | Default sequential evaluation for elementwise problems. | | Methods defined here: | | __call__(self, f, X) | Call self as a function. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.core.problem.Problem
Python Library Documentation: class Problem in module pymoo.core.problem class Problem(builtins.object) | Problem(n_var=-1, n_obj=1, n_ieq_constr=0, n_eq_constr=0, xl=None, xu=None, vtype=None, vars=None, elementwise=False, elementwise_func=<class 'pymoo.core.problem.ElementwiseEvaluationFunction'>, elementwise_runner=<pymoo.core.problem.LoopedElementwiseEvaluation object at 0x0000021837CCF980>, requires_kwargs=False, replace_nan_values_by=None, exclude_from_serialization=None, callback=None, strict=True, **kwargs) | | Methods defined here: | | __getstate__(self) | Helper for pickle. | | __init__(self, n_var=-1, n_obj=1, n_ieq_constr=0, n_eq_constr=0, xl=None, xu=None, vtype=None, vars=None, elementwise=False, elementwise_func=<class 'pymoo.core.problem.ElementwiseEvaluationFunction'>, elementwise_runner=<pymoo.core.problem.LoopedElementwiseEvaluation object at 0x0000021837CCF980>, requires_kwargs=False, replace_nan_values_by=None, exclude_from_serialization=None, callback=None, strict=True, **kwargs) | Initialize a Problem. | | Args: | n_var: Number of variables. | n_obj: Number of objectives. | n_ieq_constr: Number of inequality constraints. | n_eq_constr: Number of equality constraints. | xl: Lower bounds for variables (float/int/array). | xu: Upper bounds for variables (float/int/array). | vtype: Variable type hint. | vars: Variables in explicit form. | elementwise: Whether to use elementwise evaluation. | elementwise_func: Function for elementwise evaluation. | elementwise_runner: Runner for elementwise evaluation. | requires_kwargs: Whether evaluation requires kwargs. | replace_nan_values_by: Value to replace NaN with. | exclude_from_serialization: Attributes to exclude from serialization. | callback: Callback function after each evaluation. | strict: Whether to check shapes strictly. | **kwargs: Additional keyword arguments. | | __str__(self) | Return str(self). | | bounds(self) | | do(self, X, return_values_of, *args, **kwargs) | | evaluate(self, X, *args, return_values_of=None, return_as_dictionary=False, **kwargs) | | has_bounds(self) | | has_constraints(self) | | ideal_point = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | nadir_point = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | name(self) | | pareto_front = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | pareto_set = wrapper(self, *args, use_cache=True, set_cache=True, **kwargs) from pymoo.util.cache.Cache.<locals> | | ---------------------------------------------------------------------- | Readonly properties defined here: | | n_constr | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.core.problem.abstractmethod
Python Library Documentation: function abstractmethod in module abc
abstractmethod(funcobj)
A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or derived from it. A
class that has a metaclass derived from ABCMeta cannot be
instantiated unless all of its abstract methods are overridden.
The abstract methods can be called using any of the normal
'super' call mechanisms. abstractmethod() may be used to declare
abstract methods for properties and descriptors.
Usage:
class C(metaclass=ABCMeta):
@abstractmethod
def my_abstract_method(self, arg1, arg2, argN):
...
pymoo.core.problem.annotations
Python Library Documentation: _Feature in module __future__ object class _Feature(builtins.object) | _Feature(optionalRelease, mandatoryRelease, compiler_flag) | | Methods defined here: | | __init__(self, optionalRelease, mandatoryRelease, compiler_flag) | Initialize self. See help(type(self)) for accurate signature. | | __repr__(self) | Return repr(self). | | getMandatoryRelease(self) | Return release in which this feature will become mandatory. | | This is a 5-tuple, of the same form as sys.version_info, or, if | the feature was dropped, or the release date is undetermined, is None. | | getOptionalRelease(self) | Return first release in which this feature was recognized. | | This is a 5-tuple, of the same form as sys.version_info. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.core.problem.anp
Python Library Documentation: LazyBackend object numpy = class LazyBackend(builtins.object) | Lazy backend that always uses the current active backend. | | Methods defined here: | | __dir__(self) -> list[str] | Support for tab completion and introspection. | | __getattr__(self, name: str) -> Any | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.core.problem.at_least_2d_array
Python Library Documentation: function at_least_2d_array in module pymoo.util.misc
at_least_2d_array(x: Any, extend_as: str = 'row', return_if_reshaped: bool = False) -> Union[Any, Tuple[Any, bool]]
Ensure array is at least 2D.
Args:
x: Input array.
extend_as: How to extend 1D arrays ('row' or 'column').
return_if_reshaped: Whether to return reshape flag.
Returns:
2D array, optionally with reshape flag.
pymoo.core.problem.default_shape
Python Library Documentation: function default_shape in module pymoo.core.problem default_shape(problem, n)
pymoo.algorithms.moo.nsga2.DefaultMultiObjectiveTermination
Python Library Documentation: class DefaultMultiObjectiveTermination in module pymoo.termination.default class DefaultMultiObjectiveTermination(DefaultTermination) | DefaultMultiObjectiveTermination(xtol=0.0005, cvtol=1e-08, ftol=0.005, n_skip=5, period=50, **kwargs) -> None | | Method resolution order: | DefaultMultiObjectiveTermination | DefaultTermination | pymoo.core.termination.Termination | builtins.object | | Methods defined here: | | __init__(self, xtol=0.0005, cvtol=1e-08, ftol=0.005, n_skip=5, period=50, **kwargs) -> None | Initialize termination criterion. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.termination.Termination: | | do_continue(self) -> bool | Check whether optimization should continue. | | has_terminated(self) -> bool | Check whether termination criterion is satisfied. | | terminate(self) -> None | Force termination. | | update(self, algorithm: object) -> float | Update progress and check termination condition. | | Args: | algorithm: Algorithm instance. | | Returns: | Progress value in [0, 1]. | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.termination.Termination: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.Dominator
Python Library Documentation: class Dominator in module pymoo.util.dominator class Dominator(builtins.object) | Utility class for computing dominance relations. | | Static methods defined here: | | calc_domination_matrix(F: Any, _F: Any = None, epsilon: float = 0.0) -> Any | Calculate domination matrix using vectorized method. | | Args: | F: Population objectives array. | _F: Reference front (if None, uses F). | epsilon: Tolerance for domination relation. | | Returns: | Domination matrix where M[i,j] = 1 if i dominates j, | -1 if j dominates i, 0 otherwise. | | calc_domination_matrix_loop(F: Any, G: Any) -> Any | Calculate domination matrix using loop-based method. | | Args: | F: Population objectives array. | G: Population constraint violations array. | | Returns: | Domination matrix where M[i,j] = 1 if i dominates j, | -1 if j dominates i, 0 otherwise. | | get_relation(a: Any, b: Any, cva: Any = None, cvb: Any = None) -> int | Determine dominance relation between two objective vectors. | | Args: | a: Objective vector of first solution. | b: Objective vector of second solution. | cva: Constraint violation of first solution. | cvb: Constraint violation of second solution. | | Returns: | 1 if a dominates b, -1 if b dominates a, 0 if indifferent. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.FloatRandomSampling
Python Library Documentation: class FloatRandomSampling in module pymoo.operators.sampling.rnd class FloatRandomSampling(pymoo.core.sampling.Sampling) | FloatRandomSampling() -> None | | Random sampling operator for continuous variables. | | Method resolution order: | FloatRandomSampling | pymoo.core.sampling.Sampling | pymoo.core.operator.Operator | builtins.object | | Methods inherited from pymoo.core.sampling.Sampling: | | __init__(self) -> None | Initialize a Sampling operator. | | This abstract class represents any sampling strategy that can be used | to create an initial population or an initial search point. | | do = wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any from pymoo.util.default_random_state.<locals>.decorator.<locals> | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.operator.Operator: | | __call__(self, problem, elem, *args, to_numpy=False, **kwargs) | Call self as a function. | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.operator.Operator: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.GeneticAlgorithm
Python Library Documentation: class GeneticAlgorithm in module pymoo.algorithms.base.genetic class GeneticAlgorithm(pymoo.core.algorithm.Algorithm) | GeneticAlgorithm(pop_size=None, sampling=None, selection=None, crossover=None, mutation=None, survival=None, n_offsprings=None, eliminate_duplicates=<pymoo.core.duplicate.DefaultDuplicateElimination object at 0x000002183FC38290>, repair=None, mating=None, advance_after_initial_infill=False, **kwargs) | | Method resolution order: | GeneticAlgorithm | pymoo.core.algorithm.Algorithm | builtins.object | | Methods defined here: | | __init__(self, pop_size=None, sampling=None, selection=None, crossover=None, mutation=None, survival=None, n_offsprings=None, eliminate_duplicates=<pymoo.core.duplicate.DefaultDuplicateElimination object at 0x000002183FC38290>, repair=None, mating=None, advance_after_initial_infill=False, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.algorithm.Algorithm: | | advance(self, infills: pymoo.core.population.Population | None = None, **kwargs) -> pymoo.core.population.Population | pymoo.core.result.Result | | ask(self) -> pymoo.core.population.Population | None | | finalize(self) | | has_next(self) -> bool | | infill(self) -> pymoo.core.population.Population | None | | next(self) -> None | | result(self) -> pymoo.core.result.Result | | run(self) -> pymoo.core.result.Result | | setup(self, problem: pymoo.core.problem.Problem, verbose=False, progress=False, **kwargs) -> 'Algorithm' | | tell(self, *args, **kwargs) -> pymoo.core.population.Population | pymoo.core.result.Result | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.algorithm.Algorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | n_gen
pymoo.algorithms.moo.nsga2.MultiObjectiveOutput
Python Library Documentation: class MultiObjectiveOutput in module pymoo.util.display.multi class MultiObjectiveOutput(pymoo.util.display.output.Output) | MultiObjectiveOutput() -> None | | Output columns for multi-objective optimization results. | | Method resolution order: | MultiObjectiveOutput | pymoo.util.display.output.Output | pymoo.core.callback.Callback | builtins.object | | Methods defined here: | | __init__(self) -> None | Initialize self. See help(type(self)) for accurate signature. | | initialize(self, algorithm: Any) -> None | Initialize output columns based on the problem. | | Args: | algorithm: The optimization algorithm instance. | | update(self, algorithm: Any) -> None | Update output columns with current algorithm state. | | Args: | algorithm: The optimization algorithm instance. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.util.display.output.Output: | | header(self, border: bool = False) -> str | Generate header line for output columns. | | Args: | border: Whether to add border lines. | | Returns: | Formatted header string. | | text(self) -> str | Generate text line with column values. | | Returns: | Formatted text string with current column values. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.callback.Callback: | | __call__(self, algorithm: 'Algorithm') | Call self as a function. | | notify(self, algorithm: 'Algorithm') -> None | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.callback.Callback: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.NSGA2
Python Library Documentation: class NSGA2 in module pymoo.algorithms.moo.nsga2 class NSGA2(pymoo.algorithms.base.genetic.GeneticAlgorithm) | NSGA2(pop_size=100, sampling=<pymoo.operators.sampling.rnd.FloatRandomSampling object at 0x00000218490C7DA0>, selection=<pymoo.operators.selection.tournament.TournamentSelection object at 0x00000218490C7F20>, crossover=<pymoo.operators.crossover.sbx.SBX object at 0x00000218490E0E00>, mutation=<pymoo.operators.mutation.pm.PM object at 0x00000218490E0DD0>, survival=<pymoo.operators.survival.rank_and_crowding.classes.RankAndCrowding object at 0x00000218490E11F0>, output=<pymoo.util.display.multi.MultiObjectiveOutput object at 0x0000021848F0D190>, **kwargs) | | Method resolution order: | NSGA2 | pymoo.algorithms.base.genetic.GeneticAlgorithm | pymoo.core.algorithm.Algorithm | builtins.object | | Methods defined here: | | __init__(self, pop_size=100, sampling=<pymoo.operators.sampling.rnd.FloatRandomSampling object at 0x00000218490C7DA0>, selection=<pymoo.operators.selection.tournament.TournamentSelection object at 0x00000218490C7F20>, crossover=<pymoo.operators.crossover.sbx.SBX object at 0x00000218490E0E00>, mutation=<pymoo.operators.mutation.pm.PM object at 0x00000218490E0DD0>, survival=<pymoo.operators.survival.rank_and_crowding.classes.RankAndCrowding object at 0x00000218490E11F0>, output=<pymoo.util.display.multi.MultiObjectiveOutput object at 0x0000021848F0D190>, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.algorithm.Algorithm: | | advance(self, infills: pymoo.core.population.Population | None = None, **kwargs) -> pymoo.core.population.Population | pymoo.core.result.Result | | ask(self) -> pymoo.core.population.Population | None | | finalize(self) | | has_next(self) -> bool | | infill(self) -> pymoo.core.population.Population | None | | next(self) -> None | | result(self) -> pymoo.core.result.Result | | run(self) -> pymoo.core.result.Result | | setup(self, problem: pymoo.core.problem.Problem, verbose=False, progress=False, **kwargs) -> 'Algorithm' | | tell(self, *args, **kwargs) -> pymoo.core.population.Population | pymoo.core.result.Result | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.algorithm.Algorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | n_gen
pymoo.algorithms.moo.nsga2.PM
Python Library Documentation: class PM in module pymoo.operators.mutation.pm class PM(PolynomialMutation) | PM(prob=0.9, eta=20, at_least_once=False, **kwargs) | | Alias for PolynomialMutation. | | Method resolution order: | PM | PolynomialMutation | pymoo.core.mutation.Mutation | pymoo.core.operator.Operator | builtins.object | | Methods inherited from PolynomialMutation: | | __init__(self, prob=0.9, eta=20, at_least_once=False, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.mutation.Mutation: | | do = wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any from pymoo.util.default_random_state.<locals>.decorator.<locals> | | get_prob_var(self, problem, **kwargs) | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.operator.Operator: | | __call__(self, problem, elem, *args, to_numpy=False, **kwargs) | Call self as a function. | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.operator.Operator: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.RankAndCrowding
Python Library Documentation: class RankAndCrowding in module pymoo.operators.survival.rank_and_crowding.classes class RankAndCrowding(pymoo.core.survival.Survival) | RankAndCrowding(nds=None, crowding_func: str = 'cd') -> None | | Rank and crowding based survival operator generalization of NSGA-II. | | Ranks individuals by dominance criteria and sorts the last front by a | user-specified crowding metric. The default is NSGA-II's crowding distances. | For many-objective problems, try 'mnn' or '2nn'. For bi-objective, 'pcd' is effective. | | Method resolution order: | RankAndCrowding | pymoo.core.survival.Survival | builtins.object | | Methods defined here: | | __init__(self, nds=None, crowding_func: str = 'cd') -> None | Initialize the rank and crowding survival operator. | | Args: | nds: Non-dominated sorting implementation. Defaults to None. | crowding_func: Crowding metric function. Options: 'cd', 'pcd', 'pruning-cd', | 'ce', 'mnn', '2nn'. Can also be a callable with signature | fun(F, filter_out_duplicates=None, n_remove=None, **kwargs). | Defaults to 'cd'. | | Note: | 'pcd', 'cd', and 'ce' are recommended for two-objective problems. | 'mnn' and '2nn' are recommended for many-objective problems. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.survival.Survival: | | do = wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any from pymoo.util.default_random_state.<locals>.decorator.<locals> | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.survival.Survival: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.RankAndCrowdingSurvival
Python Library Documentation: class RankAndCrowdingSurvival in module pymoo.algorithms.moo.nsga2 class RankAndCrowdingSurvival(pymoo.operators.survival.rank_and_crowding.classes.RankAndCrowding) | RankAndCrowdingSurvival(nds=None, crowding_func='cd') | | Method resolution order: | RankAndCrowdingSurvival | pymoo.operators.survival.rank_and_crowding.classes.RankAndCrowding | pymoo.core.survival.Survival | builtins.object | | Methods defined here: | | __init__(self, nds=None, crowding_func='cd') | Initialize the rank and crowding survival operator. | | Args: | nds: Non-dominated sorting implementation. Defaults to None. | crowding_func: Crowding metric function. Options: 'cd', 'pcd', 'pruning-cd', | 'ce', 'mnn', '2nn'. Can also be a callable with signature | fun(F, filter_out_duplicates=None, n_remove=None, **kwargs). | Defaults to 'cd'. | | Note: | 'pcd', 'cd', and 'ce' are recommended for two-objective problems. | 'mnn' and '2nn' are recommended for many-objective problems. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.survival.Survival: | | do = wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any from pymoo.util.default_random_state.<locals>.decorator.<locals> | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.survival.Survival: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.SBX
Python Library Documentation: class SBX in module pymoo.operators.crossover.sbx class SBX(SimulatedBinaryCrossover) | SBX(prob_var=0.5, eta=15, prob_exch=1.0, prob_bin=0.5, n_offsprings=2, **kwargs) | | Method resolution order: | SBX | SimulatedBinaryCrossover | pymoo.core.crossover.Crossover | pymoo.core.operator.Operator | builtins.object | | Methods inherited from SimulatedBinaryCrossover: | | __init__(self, prob_var=0.5, eta=15, prob_exch=1.0, prob_bin=0.5, n_offsprings=2, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.crossover.Crossover: | | do = wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any from pymoo.util.default_random_state.<locals>.decorator.<locals> | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.operator.Operator: | | __call__(self, problem, elem, *args, to_numpy=False, **kwargs) | Call self as a function. | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.operator.Operator: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.TournamentSelection
Python Library Documentation: class TournamentSelection in module pymoo.operators.selection.tournament class TournamentSelection(pymoo.core.selection.Selection) | TournamentSelection(func_comp=None, pressure: int = 2, **kwargs) -> None | | Tournament selection operator for genetic algorithms. | | Simulates a tournament between individuals. The selection pressure balances | the greediness of the genetic algorithm. | | Method resolution order: | TournamentSelection | pymoo.core.selection.Selection | pymoo.core.operator.Operator | builtins.object | | Methods defined here: | | __init__(self, func_comp=None, pressure: int = 2, **kwargs) -> None | Initialize the tournament selection operator. | | Args: | func_comp: Comparison function with signature comp(pop, indices). | Returns the index of the winner. If None, population is assumed | to be sorted by criterion and indices are compared directly. | pressure: Selection pressure (tournament size). Default is 2 for binary tournament. | **kwargs: Additional keyword arguments. | | Raises: | Exception: If func_comp is not provided. | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.selection.Selection: | | do = wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any from pymoo.util.default_random_state.<locals>.decorator.<locals> | | ---------------------------------------------------------------------- | Methods inherited from pymoo.core.operator.Operator: | | __call__(self, problem, elem, *args, to_numpy=False, **kwargs) | Call self as a function. | | ---------------------------------------------------------------------- | Data descriptors inherited from pymoo.core.operator.Operator: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.algorithms.moo.nsga2.binary_tournament
Python Library Documentation: function binary_tournament in module pymoo.algorithms.moo.nsga2 binary_tournament(pop, P, algorithm, **kwargs)
pymoo.algorithms.moo.nsga2.compare
Python Library Documentation: function wrapper in module pymoo.util wrapper(*args: Any, random_state: Any = None, **kwargs: Any) -> Any
pymoo.algorithms.moo.nsga2.has_feasible
Python Library Documentation: function has_feasible in module pymoo.util.misc
has_feasible(pop: Any) -> bool
Check if population has feasible solutions.
Args:
pop: Population.
Returns:
True if any feasible solutions exist.
pymoo.algorithms.moo.nsga2.parse_doc_string
Python Library Documentation: function parse_doc_string in module pymoo.docs
parse_doc_string(source, dest=None, other={})
pymoo.optimize.minimize
Python Library Documentation: function minimize in module pymoo.optimize
minimize(problem, algorithm, termination=None, copy_algorithm=True, copy_termination=True, **kwargs)
Minimization of function of one or more variables, objectives and constraints.
This is used as a convenience function to execute several algorithms with default
settings which turned out to work for a test case. However, evolutionary computations
utilize the idea of customizing a meta-algorithm. Customizing the algorithm using
the object-oriented interface is recommended to improve convergence.
Args:
problem: A problem object which is defined using pymoo.
algorithm: The algorithm object that should be used for the optimization.
termination: The termination criterion that is used to stop the algorithm.
copy_algorithm: Whether the algorithm object should be copied before optimization.
copy_termination: Whether the termination object should be copied.
**kwargs: Additional arguments passed to algorithm.setup(), such as seed,
verbose, display, callback, save_history.
Returns:
The optimization result represented as an object.
pymoo.visualization.scatter.Plot
Python Library Documentation: class Plot in module pymoo.core.plot class Plot(builtins.object) | Plot(fig=None, ax=None, figsize=(8, 6), title=None, legend=False, tight_layout=False, bounds=None, reverse=False, cmap='tab10', axis_style=None, axis_label_style=None, func_number_to_text=<function default_number_to_text at 0x000002184AE27C40>, labels='f', close_on_destroy=True, **kwargs) | | Methods defined here: | | __del__(self) | | __init__(self, fig=None, ax=None, figsize=(8, 6), title=None, legend=False, tight_layout=False, bounds=None, reverse=False, cmap='tab10', axis_style=None, axis_label_style=None, func_number_to_text=<function default_number_to_text at 0x000002184AE27C40>, labels='f', close_on_destroy=True, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | add(self, F, **kwargs) | | apply(self, func) | | do(self) | | get_axes(self) | | get_figure(self) | | get_labels(self) | | get_plot(self) | | init_figure(self, n_rows=1, n_cols=1, plot_3D=False, force_axes_as_matrix=False) | | plot_if_not_done_yet(self) | | reset(self) | | save(self, fname, **kwargs) | | set_axis_style(self, **kwargs) | | show(self, **kwargs) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pymoo.visualization.scatter.Scatter
Python Library Documentation: class Scatter in module pymoo.visualization.scatter
class Scatter(pymoo.core.plot.Plot)
| Scatter(plot_3d: bool = True, angle: tuple[int, int] = (45, 45), **kwargs) -> None
|
| Scatter plot visualization.
|
| Args:
| plot_3d: Whether to plot 3D scatter plots.
| angle: The viewing angle for 3D plots.
| axis_style: {axis_style}
| labels: {labels}
| figsize: {figsize}
| title: {title}
| legend: {legend}
| tight_layout: {tight_layout}
|
| Method resolution order:
| Scatter
| pymoo.core.plot.Plot
| builtins.object
|
| Methods defined here:
|
| __init__(self, plot_3d: bool = True, angle: tuple[int, int] = (45, 45), **kwargs) -> None
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from pymoo.core.plot.Plot:
|
| __del__(self)
|
| add(self, F, **kwargs)
|
| apply(self, func)
|
| do(self)
|
| get_axes(self)
|
| get_figure(self)
|
| get_labels(self)
|
| get_plot(self)
|
| init_figure(self, n_rows=1, n_cols=1, plot_3D=False, force_axes_as_matrix=False)
|
| plot_if_not_done_yet(self)
|
| reset(self)
|
| save(self, fname, **kwargs)
|
| set_axis_style(self, **kwargs)
|
| show(self, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pymoo.core.plot.Plot:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
pymoo.visualization.scatter.parse_doc_string
Python Library Documentation: function parse_doc_string in module pymoo.docs
parse_doc_string(source, dest=None, other={})
pymoo.visualization.scatter.plot_1d
Python Library Documentation: function plot_1d in module pymoo.visualization.scatter plot_1d(sc) -> None
pymoo.visualization.scatter.plot_2d
Python Library Documentation: function plot_2d in module pymoo.visualization.scatter plot_2d(sc)
pymoo.visualization.scatter.plot_3d
Python Library Documentation: function plot_3d in module pymoo.visualization.scatter plot_3d(sc, angle) -> None
pymoo.visualization.scatter.plot_pairwise
Python Library Documentation: function plot_pairwise in module pymoo.visualization.scatter plot_pairwise(sc) -> None
pymoo.visualization.scatter.set_if_none
Python Library Documentation: function set_if_none in module pymoo.util.misc
set_if_none(kwargs: dict, str: str, val: Any) -> None
Set dictionary value if key is not present.
Args:
kwargs: Dictionary.
str: Key.
val: Value to set.