monobjective_PSO

Module Contents

Classes

class MaxTimeTerminationCondition(maxTime)[source]
shouldTerminate()[source]
class ConvergenceTerminationCondition(convergence, minrelchange_percent=0.1, nb_generation=15)[source]
shouldTerminate()[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