RobustOptimizationProblem

class otrobopt.RobustOptimizationProblem(*args)

Robust optimization problem.

Must consist at least of one MeasureEvaluation, either on the objective or the constraint.

Available constructors:

RobustOptimizationProblem(robustnessMeasure, reliabilityMeasure)

RobustOptimizationProblem(objective, reliabilityMeasure)

RobustOptimizationProblem(robustnessMeasure, inequalityConstraint)

Parameters:
robustnessMeasureMeasureEvaluation

Measure function on the objective.

reliabilityMeasureMeasureEvaluation

Mesure function on the constraints

objectiveopenturns.Function

Objective function

inequalityConstraintopenturns.Function

Inequality constraint

Examples

>>> import openturns as ot
>>> import otrobopt

Pure robustness problem:

>>> thetaDist = ot.Normal(2.0, 0.1)
>>> f_base = ot.SymbolicFunction(['x1', 'theta'], ['x1*theta+cos(x1+theta)'])
>>> f = ot.ParametricFunction(f_base, [1], [1.0])
>>> robustnessMeasure = otrobopt.VarianceMeasure(f, thetaDist) 
>>> problem = otrobopt.RobustOptimizationProblem(robustnessMeasure, ot.Function())
>>> algo = ot.Cobyla(problem)
>>> algo.setStartingPoint([0.0]*robustnessMeasure.getInputDimension())
>>> algo.run()
>>> x_et = algo.getResult().getOptimalPoint()
>>> print(x_et)
[0.55...]
>>> J_et = algo.getResult().getOptimalValue()
>>> print(J_et)
[3.42...e-05]

Robustness problem with deterministic constraint:

>>> thetaDist = ot.Normal(2.0, 0.1)
>>> f_base = ot.SymbolicFunction(['x1', 'theta'], ['x1*theta'])
>>> f = ot.ParametricFunction(f_base, [1], [1.0])
>>> robustnessMeasure = otrobopt.MeanMeasure(f, thetaDist)
>>> g = ot.SymbolicFunction(['x1'], ['x1 - 5.0'])
>>> problem = otrobopt.RobustOptimizationProblem(robustnessMeasure, g)
>>> algo = ot.Cobyla(problem)
>>> algo.setStartingPoint([0.0]*robustnessMeasure.getInputDimension())
>>> algo.run()
>>> x_et = algo.getResult().getOptimalPoint()
>>> J_et = algo.getResult().getOptimalValue()

Pure reliability problem:

>>> thetaDist = ot.Normal(2.0, 0.1)
>>> f = ot.SymbolicFunction(['x1'], ['x1+1'])
>>> g_base = ot.SymbolicFunction(['x1', 'theta'], ['x1+theta'])
>>> g = ot.ParametricFunction(g_base, [1], [1.0])
>>> reliabilityMeasure = otrobopt.JointChanceMeasure(g, thetaDist, ot.Greater(), 0.95)
>>> problem = otrobopt.RobustOptimizationProblem(f, reliabilityMeasure)
>>> algo = ot.Cobyla(problem)
>>> algo.setStartingPoint([0.0]*robustnessMeasure.getInputDimension())
>>> algo.run()
>>> x_et = algo.getResult().getOptimalPoint()
>>> print(x_et)
[-1.83...]
>>> J_et = algo.getResult().getOptimalValue()
>>> print(J_et)
[-0.83...]

Robustness & reliability problem:

>>> thetaDist = ot.Normal(2.0, 0.1)
>>> f_base = ot.SymbolicFunction(['x1', 'theta'], ['x1*theta'])
>>> f = ot.ParametricFunction(f_base, [1], [1.0])
>>> robustnessMeasure = otrobopt.MeanMeasure(f, thetaDist)
>>> g_base = ot.SymbolicFunction(['x1', 'theta'], ['x1+theta'])
>>> g = ot.ParametricFunction(g_base, [1], [1.0])
>>> reliabilityMeasure = otrobopt.JointChanceMeasure(g, thetaDist, ot.Greater(), 0.95)
>>> problem = otrobopt.RobustOptimizationProblem(robustnessMeasure, reliabilityMeasure)
>>> algo = ot.Cobyla(problem)
>>> algo.setStartingPoint([0.0]*robustnessMeasure.getInputDimension())
>>> algo.run()
>>> x_et = algo.getResult().getOptimalPoint()
>>> print(x_et)
[-1.83...]
>>> J_et = algo.getResult().getOptimalValue()
>>> print(J_et)
[-3.67...]

Methods

getBounds()

Accessor to bounds.

getClassName()

Accessor to the object's name.

getDimension()

Accessor to input dimension.

getDistribution()

Distribution accessor.

getEqualityConstraint()

Accessor to equality constraints.

getId()

Accessor to the object's id.

getInequalityConstraint()

Accessor to inequality constraints.

getLevelFunction()

Accessor to level function.

getLevelValue()

Accessor to level value.

getName()

Accessor to the object's name.

getObjective()

Accessor to objective function.

getReliabilityMeasure()

Reliability measure accessor.

getResidualFunction()

Accessor to level function.

getRobustnessMeasure()

Robustness measure accessor.

getShadowedId()

Accessor to the object's shadowed id.

getVariablesType()

Accessor to the variables type.

getVisibility()

Accessor to the object's visibility state.

hasBounds()

Test whether bounds had been specified.

hasEqualityConstraint()

Test whether equality constraints had been specified.

hasInequalityConstraint()

Test whether inequality constraints had been specified.

hasLevelFunction()

Test whether level function had been specified.

hasMultipleObjective()

Test whether objective function is a scalar or vector function.

hasName()

Test if the object is named.

hasReliabilityMeasure()

Reliability measure flag accessor.

hasResidualFunction()

Test whether a least-square problem is defined.

hasRobustnessMeasure()

Robustness measure flag accessor.

hasVisibleName()

Test if the object has a distinguishable name.

isContinuous()

Check if the problem is continuous.

isMinimization([marginalIndex])

Test whether this is a minimization or maximization problem.

setBounds(bounds)

Accessor to bounds.

setEqualityConstraint(equalityConstraint)

Accessor to equality constraints.

setInequalityConstraint(inequalityConstraint)

Accessor to inequality constraints.

setLevelFunction(levelFunction)

Accessor to level function.

setLevelValue(levelValue)

Accessor to level value.

setMinimization(minimization[, marginalIndex])

Tell whether this is a minimization or maximization problem.

setName(name)

Accessor to the object's name.

setObjective(objective)

Accessor to objective function.

setReliabilityMeasure(reliabilityMeasure)

Reliability measure accessor.

setResidualFunction(residualFunction)

Accessor to level function.

setRobustnessMeasure(robustnessMeasure)

Robustness measure accessor.

setShadowedId(id)

Accessor to the object's shadowed id.

setVariablesType(variableType)

Accessor to the variables type.

setVisibility(visible)

Accessor to the object's visibility state.

__init__(*args)
getBounds()

Accessor to bounds.

Returns:
boundsInterval

Problem bounds.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getDimension()

Accessor to input dimension.

Returns:
dimensionint

Input dimension of objective function.

getDistribution()

Distribution accessor.

Returns:
distributionopenturns.Distribution

Parameter distribution

getEqualityConstraint()

Accessor to equality constraints.

Returns:
equalityFunction

Describe equality constraints.

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getInequalityConstraint()

Accessor to inequality constraints.

Returns:
inequalityFunction

Describe inequality constraints.

getLevelFunction()

Accessor to level function.

Returns:
levelFunction

Level function.

getLevelValue()

Accessor to level value.

Returns:
valuefloat

Level value.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getObjective()

Accessor to objective function.

Returns:
objectiveFunction

Objective function.

getReliabilityMeasure()

Reliability measure accessor.

The measure on associated to the constraint

Returns:
reliabilityMeasureMeasureEvaluation

Mesure function on the constraints

getResidualFunction()

Accessor to level function.

Returns:
levelFunction

Level function.

getRobustnessMeasure()

Robustness measure accessor.

The measure on associated to the objective function

Returns:
robustnessMeasureMeasureEvaluation

Measure function on the objective.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
idint

Internal unique identifier.

getVariablesType()

Accessor to the variables type.

Returns:
variablesTypeIndices

Types of the variables.

Notes

Possible values for each variable are ot.OptimizationProblemImplementation.CONTINUOUS, ot.OptimizationProblemImplementation.INTEGER and ot.OptimizationProblemImplementation.`BINARY`.

getVisibility()

Accessor to the object’s visibility state.

Returns:
visiblebool

Visibility flag.

hasBounds()

Test whether bounds had been specified.

Returns:
valuebool

True if bounds had been set for this problem, False otherwise.

hasEqualityConstraint()

Test whether equality constraints had been specified.

Returns:
valuebool

True if equality constraints had been set for this problem, False otherwise.

hasInequalityConstraint()

Test whether inequality constraints had been specified.

Returns:
valuebool

True if inequality constraints had been set for this problem, False otherwise.

hasLevelFunction()

Test whether level function had been specified.

Returns:
valuebool

True if level function had been set for this problem, False otherwise.

hasMultipleObjective()

Test whether objective function is a scalar or vector function.

Returns:
valuebool

False if objective function is scalar, True otherwise.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hasReliabilityMeasure()

Reliability measure flag accessor.

If no reliability measure was set, the problem should have a robustness measure. The constraints are deduced from the reliability measure.

Returns:
hasReliabilityMeasurebool

Whether a reliability measure was set

hasResidualFunction()

Test whether a least-square problem is defined.

Returns:
valuebool

True if this is a least-squares problem, False otherwise.

hasRobustnessMeasure()

Robustness measure flag accessor.

If no robustness measure was set, the problem should have a reliability measure. The objective is deduced from the robustness measure.

Returns:
hasReliabilityMeasurebool

Whether a robustness measure was set

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleNamebool

True if the name is not empty and not the default one.

isContinuous()

Check if the problem is continuous.

Returns:
isContinuousbool

Returns True if all variables are continuous.

isMinimization(marginalIndex=0)

Test whether this is a minimization or maximization problem.

Parameters:
marginal_indexint, default=0

Index of the output marginal (for multi-objective only)

Returns:
valuebool

True if this is a minimization problem (default), False otherwise.

setBounds(bounds)

Accessor to bounds.

Parameters:
boundsInterval

Problem bounds.

setEqualityConstraint(equalityConstraint)

Accessor to equality constraints.

Parameters:
equalityConstraintFunction

Equality constraints.

setInequalityConstraint(inequalityConstraint)

Accessor to inequality constraints.

Parameters:
inequalityConstraintFunction

Inequality constraints.

setLevelFunction(levelFunction)

Accessor to level function.

Parameters:
levelFunctionFunction

Level function.

setLevelValue(levelValue)

Accessor to level value.

Parameters:
levelValuefloat

Level value.

setMinimization(minimization, marginalIndex=0)

Tell whether this is a minimization or maximization problem.

Parameters:
minimizationbool

True if this is a minimization problem, False otherwise.

marginal_indexint, default=0

Index of the output marginal (for multi-objective only)

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setObjective(objective)

Accessor to objective function.

Parameters:
objectiveFunctionFunction

Objective function.

Notes

Constraints and bounds are cleared if the objective has a different input dimension in order to keep the problem valid at all time.

setReliabilityMeasure(reliabilityMeasure)

Reliability measure accessor.

The measure on associated to the constraint

Parameters:
reliabilityMeasureMeasureEvaluation

Mesure function on the constraints

setResidualFunction(residualFunction)

Accessor to level function.

Parameters:
levelFunctionFunction

Level function.

setRobustnessMeasure(robustnessMeasure)

Robustness measure accessor.

The measure on associated to the objective function

Parameters:
robustnessMeasureMeasureEvaluation

Measure function on the objective.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:
idint

Internal unique identifier.

setVariablesType(variableType)

Accessor to the variables type.

Parameters:
variablesTypeIndices

Types of the variables.

Notes

Possible values for each variable are ot.OptimizationProblemImplementation.CONTINUOUS, ot.OptimizationProblemImplementation.INTEGER and ot.OptimizationProblemImplementation.BINARY.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visiblebool

Visibility flag.