optimizer

Module Contents

default
class PipeOptimization[source]

Provides a live interface of the current optimization

get_device(self)[source]
Returns

InterfaceDevice (not process safe, deprecated)

get_historic(self)[source]
Returns

OptiHistoric

set_device(self, theDevice)[source]
set_historic(self, theHistoric)[source]
class OptiHistoric(**kwargs)[source]

Bases: object

Contains all the points that have been evaluated

class _pointData(currTime, objectives, constraints)[source]
time :float
objectives :List[float]
constraints :List[float]
_DEVICE = autosaved
_LOGOPTI = logopti
_RESULTS = results
_CONVERGENCE = optiConvergence
add_point(self, device, currTime, objectives, constraints)[source]
set_results(self, devicesList)[source]
set_convergence(self, theConvergence)[source]
set_info(self, theInfo)[source]
save(self)[source]
get_results(self)[source]
get_convergence(self)[source]
Returns

convergence InterfaceConvergence

get_devices(self)[source]
Returns

List of devices (ordered by evaluation number)

get_logopti(self)[source]
Returns

Log optimization (to check the convergence)

class Optimizer[source]

Bases: optimeed.core.options.Option_class

Main optimizing class

DISPLAY_INFO = 1
KWARGS_OPTIHISTO = 2
set_optimizer(self, theDevice, theObjectiveList, theConstraintList, theOptimizationVariables, theOptimizationAlgorithm=default['Algo'], theCharacterization=default['Charac'], theMathsToPhysics=default['M2P'])[source]

Prepare the optimizer for the optimization.

Parameters
Returns

PipeOptimization

run_optimization(self)[source]

Perform the optimization.

Returns

Collection of the best optimized devices

set_max_opti_time(self, max_time_sec)[source]
evaluateObjectiveAndConstraints(self, x)[source]

Evaluates the performances of device associated to entrance vector x. Outputs the objective function and the constraints, and other data used in optiHistoric.

This function is NOT process safe: “self.” is actually a FORK in multiprocessing algorithms. It means that the motor originally contained in self. is modified only in the fork, and only gathered by reaching the end of the fork. It is not (yet?) possible to access this motor on the main process before the end of the fork. This behaviour could be changed by using pipes or Managers.

Parameters

x – Input mathematical vector from optimization algorithm

Returns

dictionary, containing objective values (list of scalar), constraint values (list of scalar), and other info (motor, time)

callback_on_evaluation(self, returnedValues)[source]

Save the output of evaluateObjectiveAndConstraints to optiHistoric. This function should be called by the optimizer IN a process safe context.

formatInfo(self)[source]