OptimizationResult¶
-
class
OptimizationResult
(*args)¶ Optimization result.
Returned by optimization solvers, see
OptimizationAlgorithm
.- Available constructors:
OptimizationResult(optimalPoint, optimalValue, evaluationNumber, absoluteError, relativeError, residualError, constraintError)
- Parameters
- optimalPointsequence of float
Optimal point.
- optimalValuesequence of float
Value at optimal point.
- evaluationNumberint
Number of evaluations.
- absoluteErrorfloat
Parameters for this solver.
- relativeErrorfloat
Relative error.
- residualErrorfloat
Residual error.
- constraintErrorfloat
Constraint error.
- problem
OptimizationProblem
Associated problem.
Methods
drawErrorHistory
(self)Draw the convergence criteria history.
drawOptimalValueHistory
(self)Draw the optimal value history.
getAbsoluteError
(self)Accessor to the absolute error.
getAbsoluteErrorHistory
(self)Accessor to the evolution of the absolute error.
getClassName
(self)Accessor to the object’s name.
getConstraintError
(self)Accessor to the constraint error.
Accessor to the evolution of the constraint error.
getEvaluationNumber
(self)Accessor to the number of evaluations.
getId
(self)Accessor to the object’s id.
getInputSample
(self)Accessor to the input sample.
getIterationNumber
(self)Accessor to the number of iterations.
getLagrangeMultipliers
(self)Accessor to the Lagrange multipliers.
getName
(self)Accessor to the object’s name.
getOptimalPoint
(self)Accessor to the optimal point.
getOptimalValue
(self)Accessor to the optimal value.
getOutputSample
(self)Accessor to the output sample.
getProblem
(self)Accessor to the underlying optimization problem.
getRelativeError
(self)Accessor to the relative error.
getRelativeErrorHistory
(self)Accessor to the evolution of the relative error.
getResidualError
(self)Accessor to the residual error.
getResidualErrorHistory
(self)Accessor to the evolution of the residual error.
getShadowedId
(self)Accessor to the object’s shadowed id.
getVisibility
(self)Accessor to the object’s visibility state.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
setEvaluationNumber
(self, evaluationNumber)Accessor to the number of evaluation.
setIterationNumber
(self, iterationNumber)Accessor to the number of iterations.
setLagrangeMultipliers
(self, lagrangeMultipliers)Accessor to the Lagrange multipliers.
setName
(self, name)Accessor to the object’s name.
setOptimalPoint
(self, optimalPoint)Accessor to the optimal point.
setOptimalValue
(self, optimalValue)Accessor to the optimal value.
setProblem
(self, problem)Accessor to the underlying optimization problem.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVisibility
(self, visible)Accessor to the object’s visibility state.
store
-
__init__
(self, \*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
drawErrorHistory
(self)¶ Draw the convergence criteria history.
- Returns
- graph
Graph
Convergence criteria history graph
- graph
-
drawOptimalValueHistory
(self)¶ Draw the optimal value history.
- Returns
- graph
Graph
Optimal value history graph
- graph
-
getAbsoluteError
(self)¶ Accessor to the absolute error.
- Returns
- absoluteErrorfloat
Absolute error, defined by where and are two consecutive approximations of the optimum.
-
getAbsoluteErrorHistory
(self)¶ Accessor to the evolution of the absolute error.
- Returns
- absoluteErrorHistory
Sample
Value of the absolute error at each function evaluation.
- absoluteErrorHistory
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getConstraintError
(self)¶ Accessor to the constraint error.
- Returns
- constraintErrorfloat
Constraint error, defined by where is the current approximation of the optimum and is the function that gathers all the equality and inequality constraints (violated values only).
-
getConstraintErrorHistory
(self)¶ Accessor to the evolution of the constraint error.
- Returns
- constraintErrorHistory
Sample
Value of the constraint error at each function evaluation.
- constraintErrorHistory
-
getEvaluationNumber
(self)¶ Accessor to the number of evaluations.
- Returns
- evaluationNumberint
Number of evaluations.
-
getId
(self)¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getInputSample
(self)¶ Accessor to the input sample.
- Returns
- inputSample
Sample
Input points used by the solver
- inputSample
-
getIterationNumber
(self)¶ Accessor to the number of iterations.
- Returns
- iterationNumberint
Number of iterations.
-
getLagrangeMultipliers
(self)¶ Accessor to the Lagrange multipliers.
- Returns
- multipliers
Point
Lagrange multipliers.
- multipliers
Notes
See
OptimizationAlgorithm
for the details on how the multipliers are defined and stored in the result.
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getOptimalValue
(self)¶ Accessor to the optimal value.
- Returns
- optimalValue
Point
Value at the optimal point
- optimalValue
-
getOutputSample
(self)¶ Accessor to the output sample.
- Returns
- outputSample
Sample
Output points used by the solver
- outputSample
-
getProblem
(self)¶ Accessor to the underlying optimization problem.
- Returns
- problem
OptimizationProblem
Problem corresponding to the result
- problem
-
getRelativeError
(self)¶ Accessor to the relative error.
- Returns
- relativeErrorfloat
Relative error, defined by if , else .
-
getRelativeErrorHistory
(self)¶ Accessor to the evolution of the relative error.
- Returns
- relativeErrorHistory
Sample
Value of the relative error at each function evaluation.
- relativeErrorHistory
-
getResidualError
(self)¶ Accessor to the residual error.
- Returns
- residualErrorfloat
Relative error, defined by if , else .
-
getResidualErrorHistory
(self)¶ Accessor to the evolution of the residual error.
- Returns
- residualErrorHistory
Sample
Value of the residual error at each function evaluation.
- residualErrorHistory
-
getShadowedId
(self)¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVisibility
(self)¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
hasName
(self)¶ Test if the object is named.
- Returns
- hasNamebool
True if the name is not empty.
-
hasVisibleName
(self)¶ Test if the object has a distinguishable name.
- Returns
- hasVisibleNamebool
True if the name is not empty and not the default one.
-
setEvaluationNumber
(self, evaluationNumber)¶ Accessor to the number of evaluation.
- Parameters
- evaluationNumberint
Number of evaluations.
-
setIterationNumber
(self, iterationNumber)¶ Accessor to the number of iterations.
- Parameters
- iterationNumberint
Number of iterations.
-
setLagrangeMultipliers
(self, lagrangeMultipliers)¶ Accessor to the Lagrange multipliers.
- Parameters
- multipliers
Point
Lagrange multipliers.
- multipliers
Notes
See
OptimizationAlgorithm
for the details on how the multipliers are defined and stored in the result.
-
setName
(self, name)¶ Accessor to the object’s name.
- Parameters
- namestr
The name of the object.
-
setOptimalPoint
(self, optimalPoint)¶ Accessor to the optimal point.
- Parameters
- optimalPoint
Point
Optimal point
- optimalPoint
-
setOptimalValue
(self, optimalValue)¶ Accessor to the optimal value.
- Parameters
- optimalValue
Point
Value at the optimal point
- optimalValue
-
setProblem
(self, problem)¶ Accessor to the underlying optimization problem.
- Parameters
- problem
OptimizationProblem
Problem corresponding to the result
- problem
-
setShadowedId
(self, id)¶ Accessor to the object’s shadowed id.
- Parameters
- idint
Internal unique identifier.
-
setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.