optimizer
¶
Module Contents¶
-
default
¶
-
class
PipeOptimization
¶ Provides a live interface of the current optimization
-
get_device
(self)¶ Returns: InterfaceDevice
(not process safe, deprecated)
-
get_historic
(self)¶ Returns: OptiHistoric
-
set_device
(self, theDevice)¶
-
set_historic
(self, theHistoric)¶
-
-
class
OptiHistoric
(**kwargs)¶ Bases:
object
Contains all the points that have been evaluated
-
class
_pointData
(currTime, objectives, constraints)¶ -
time
:float¶
-
objectives
:List[float]¶
-
constraints
:List[float]¶
-
-
_DEVICE
= autosaved¶
-
_LOGOPTI
= logopti¶
-
_RESULTS
= results¶
-
_CONVERGENCE
= optiConvergence¶
-
add_point
(self, device, currTime, objectives, constraints)¶
-
set_results
(self, devicesList)¶
-
set_convergence
(self, theConvergence)¶
-
set_info
(self, theInfo)¶
-
save
(self)¶
-
get_results
(self)¶
-
get_convergence
(self)¶ Returns: convergence InterfaceConvergence
-
get_devices
(self)¶ Returns: List of devices (ordered by evaluation number)
-
get_logopti
(self)¶ Returns: Log optimization (to check the convergence)
-
class
-
class
Optimizer
¶ 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'])¶ Prepare the optimizer for the optimization.
Parameters: - theDevice – object of type
InterfaceDevice
- theCharacterization – object of type
InterfaceCharacterization
- theMathsToPhysics – object of type
InterfaceMathsToPhysics
- theObjectiveList – list of objects of type
InterfaceObjCons
- theConstraintList – list of objects of type
InterfaceObjCons
- theOptimizationAlgorithm – list of objects of type
AlgorithmInterface
- theOptimizationVariables – list of objects of type
OptimizationVariable
Returns: - theDevice – object of type
-
run_optimization
(self)¶ Perform the optimization.
Returns: Collection
of the best optimized machines
-
set_max_opti_time
(self, max_time_sec)¶
-
evaluateObjectiveAndConstraints
(self, x)¶ Evaluates the performances of machine 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)¶ Save the output of evaluateObjectiveAndConstraints to optiHistoric. This function should be called by the optimizer IN a process safe context.
-
formatInfo
(self)¶
-