4.8. pyopus.optimizer.de — Box constrained differential evolution optimizer

Inheritance diagram of pyopus.optimizer.de

Box constrained differential evolution global optimizer (PyOPUS subsystem name: DEOPT)

Published first in

Storn R., Price K.: Differential evolution - a simple and efficient heuristic for global optimization over continuous spaces. Journal of Global Optimization vol. 11, pp. 341–359, 1997.

class pyopus.optimizer.de.MsgEvaluatePoint(x)
A message requesting the evaluation of a point x.
class pyopus.optimizer.de.MsgResult(x, f, annotations=None)

A message holding the result of the evaluation of a point x.

f is the result of the cost function evaluation while annotations holds the corresponding annotations.

class pyopus.optimizer.de.DifferentialEvolution(function, xlo, xhi, debug=0, fstop=None, maxiter=None, vm=None, maxSlaves=None, minSlaves=0, maxGen=None, populationSize=100, w=0.5, pc=0.29999999999999999)

Box constrained differential evolution global optimizer class

If debug is above 1, the debug option of the EventDrivenMS class is set to 1.

The lower and upper bound (xlo and xhi) must both be finite.

maxGen is the maximal number of generations. It sets an upper bound on the number of iterations to be the greater of the following two values: maxiter and (maxGen+1) \cdot populationSize.

populationSize is the number of inidividuals (points) in the population.

w is the differential weight between 0 and 2.

pc is the crossover probability between 0 and 1.

If a virtual machine object is passed in the vm argument the algorithm runs in parallel on the virtual machine represented by vm. The algorithm can also run locally (vm set to None).

The algorithm is capable of handling notification messages received when a slave fails or a new host joins the virtual machine. In the first case the work that was performed by the failed slave is reassigned. In the second case new slaves are spawned. The latter is performed by the handler in the EventDrivenMS class. Work is assigned to new slaves when the algorithm detects that they are idle.

Infinite bounds are allowed. This means that the algorithm behaves as an unconstrained algorithm if lower bounds are -\infty and upper bounds are +\infty. In this case the initial population must be defined with the reset() method.

See the BoxConstrainedOptimizer and the EventDrivenMS classes for more information.

check()
Checks the optimization algorithm’s settings and raises an exception if something is wrong.
fillHandlerTable()
Fills the handler table of the EventDrivenMS object with the handlers that take care of the PSADE’s messages.
generatePoint(i)
Generates a new point through mutation and crossover.
handleEvaluatePoint(source, message)
Handles MsgEvaluatePoint messages received by slaves. Evaluates the received point and sends back a MsgResult message.
handleIdle(source, message)

Handles a MsgIdle message.

Distributes work to the slaves.

In the beginning the initial population is evaluated in parallel (if possible) by sending class:MsgEvaluatePoint messages to slaves.

After the initial population was evaluated the main part of the algorithm starts to produce offspring and evaluates them on slaves.

handleResult(source, message)

Handles a MsgResult message and takes care of the evaluation result.

Marks the slave that sent the message as idle so that new work can be assigned to it by the MsgIdle message handler.

handleSlaveStarted(source, message)
Handles the MsgSlaveStarted message received by the master from a freshly started slave. Does nothing special, just calls the inherited handler from the EventDrivenMS class.
handleStartup(source, message)

Handles a MsgStartup message received by master/slave when the event loop is entered.

Performs some initializations on the master and prevents the plugins in the slave from printing messages.

handleTaskExit(source, message)

Handles a notification message reporting that a slave has failed (is down).

Stores the work that was performed at the time the slave failed so it can later be reassigned to some other slave.

initialPopulation()

Constructs and returns the initial population.

Fails if any bound is infinite.

reset(x0=None)

Puts the optimizer in its initial state.

x is eiter the initial point (which must be within bounds and is ignored) or the initial population in the form of a 2-dimensional array or list where the first index is the population member index while the second index is the component index. The initial population must lie within bounds xlo and xhi and have populationSize members.

If x is None the initial population is generated automatically. In this case xlo and xhi determine the dimension of the problem. See the initialPopulation() method.

run()
Runs the optimization algorithm.

Previous topic

4.7. pyopus.optimizer.ppe — Parallel point evaluator

Next topic

4.9. pyopus.optimizer.psade — Box constrained parallel SADE global optimizer

This Page