optiAlgorithms

Package Contents

Classes

class MultiObjective_GA(theGenerator=MyGenerator)[source]

Bases: optimeed.optimize.optiAlgorithms.algorithmInterface.AlgorithmInterface, optimeed.core.Option_class

Based on Platypus Library. Workflow: Define what to optimize and which function to call with a Problem Define the initial population with a Generator Define the algorithm. As options, define how to evaluate the elements with a Evaluator, i.e., for multiprocessing. Define what is the termination condition of the algorithm with TerminationCondition. Here, termination condition is a maximum time.

initialize(initialVectorGuess, listOfOptimizationVariables)[source]

This function is called just before running optimization algorithm.

compute()[source]

Launch the optimization

Returns:vector of optimal variables
set_evaluationFunction(evaluationFunction, callback_on_evaluation, numberOfObjectives, numberOfConstraints, array_evaluator)[source]

Set the evaluation function and all the necessary callbacks

Parameters:
  • evaluationFunction – check evaluateObjectiveAndConstraints()
  • callback_on_evaluation – check callback_on_evaluation(). Call this function after performing the evaluation of the individuals
  • numberOfObjectives – int, number of objectives
  • numberOfConstraints – int, number of constraints
  • array_evaluator – If True, evaluate each generation at once using numpy array. Use it only with care, as it dismisses some features (expert mode)
set_maxtime(maxTime)[source]

Set maximum optimization time (in seconds)

__str__()[source]

Return str(self).

get_convergence()[source]

This function is called just before compute. Because the convergence is contained in opti algorithm, it must be created now.

add_terminationCondition(theTerminationCondition)[source]
reset()[source]
class Monobjective_PSO[source]

Bases: optimeed.optimize.optiAlgorithms.algorithmInterface.AlgorithmInterface, optimeed.core.Option_class

Interface for the optimization algorithm

initialize(initialVectorGuess, listOfOptimizationVariables)[source]

This function is called once parameters can’t be changed anymore, before “get_convergence”.

Parameters:
Returns:

compute()[source]

Launch the optimization

Returns:vector of optimal variables
set_evaluationFunction(evaluationFunction, callback_on_evaluate, numberOfObjectives, _numberOfConstraints, array_evaluator)[source]

Set the evaluation function and all the necessary callbacks

Parameters:
  • evaluationFunction – check evaluateObjectiveAndConstraints()
  • callback_on_evaluation – check callback_on_evaluation(). Call this function after performing the evaluation of the individuals
  • numberOfObjectives – int, number of objectives
  • numberOfConstraints – int, number of constraints
  • array_evaluator – If True, evaluate each generation at once using numpy array. Use it only with care, as it dismisses some features (expert mode)
set_terminationCondition(theTerminationCondition)[source]
set_maxtime(maxTime)[source]

Set maximum optimization time (in seconds)

__str__()[source]

Return str(self).

get_convergence()[source]

Get the convergence of the optimization

Returns:InterfaceConvergence