Documentation/Modules/ConstraintHandler: Unterschied zwischen den Versionen

Aus OpenDino
Wechseln zu: Navigation, Suche
(Created page with "==Summary== Some optimization problems require objective functions as well as constraints. require bounds on the design variables '''x...")
 
(Module Description)
 
(19 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 +
[[Documentation/Modules | << BACK TO MODULE OVERVIEW <<]]
 +
 
==Summary==
 
==Summary==
  
Some optimization problems require objective functions as well as [[Documentation/Notation#constraints | constraints]].
+
Some optimization problems define [[Documentation/Notation#objectives | objectives]] as well as  
 +
[[Documentation/Notation#constraints | constraints]].
  
require bounds on the design variables '''xxx'''. E.g. for the diameter of any mechanical support must be above a certain minimum value.
+
For example, one can set for the optimization problem [[Documentation/Modules/ProblemTruss | <code>ProblemTruss </code>]] the weight of the truss to be minimized, while a constraint is set on the maximum stress and displacement of the truss.
  
As not all optimization algorithms include bound handling, the module <code>BoundHandler</code> was created.
+
This module aggregates objectives and constraints into a single output.
  
 
==Properties==
 
==Properties==
Zeile 26: Zeile 29:
 
|-
 
|-
 
! Boundaries
 
! Boundaries
| Design variables values outside the boundaries are corrected
+
| not affected
 
|-
 
|-
 
! Initial Search Region  
 
! Initial Search Region  
Zeile 65: Zeile 68:
 
==Module Description==  
 
==Module Description==  
  
The optimization algorithm proposes one or several new solutions '''x'''. Some values of '''x''' might be outside the lower bounds x<sub>l</sub> and upper bounds x<sub>u</sub>, specified in the "Problem" module. These variables are corrected to values within the bounds by thress different methods:
+
The result of an evaluation of a solution may contain objective values '''f''' and constraint values '''g''':
  
0. no bound handling
+
While bjectives are to be minimized (<code>min('''f''')</code>), constraints are to be fulfilled (<code>'''g''' =< 0</code>).  
  
This option turns off the bound handling.
+
'''0. No Constraint Handling'''
  
1. set to bounds
+
This option turns off the constraint handling. Objective values and constraints are not changed.
  
If one of the variables x is below or above the bounds, it is set to the bound value, i.e.
+
'''1. Delete Constraints'''
  
    if x < x<sub>l</sub>, then x = x<sub>l</sub>
+
Deletes all constraints. This can be used if the goal is to minimize the objective function(s) only. The objective functions are not changed.
    else if x > x<sub>u</sub>, then x = x<sub>u</sub>
 
  
2. reflect
+
'''2. Penalty Method'''
  
If one of the variables x is below or above the bounds, it is reflected from the bound.
+
To each objective function, a penalty (larger or equal to zero) is added. All violated constraints (i.e. the constraint value is >= 0) are summed and multiplied with a penalty factor <code>p</code>:
The reflection is done such that if x goes to infinity, x is equal to the lower bound and if x goes to
 
minus infinity, it is set to the upper bound.
 
  
    if x < x<sub>l</sub>, then x = x<sub>u</sub> + (x<sub>l</sub>- x<sub>u</sub>)^2 / (x - x<sub>u</sub>)
+
  penalized objective i = f<sub>i</sub> + sum<sub>j</sub>(max(g<sub>j</sub>,0))*p
  
    else if x > x<sub>u</sub>, then x = x<sub>l</sub> + (x<sub>u</sub>- x<sub>l</sub>)^2 / (x - x<sub>l</sub>)
+
Increasing the penalty factor <code>p</code> puts more weight on the constraints compared to the objectives.
 +
 
 +
'''3. Stochastic Ranking'''
 +
 
 +
Limitations:
 +
# only for single objective problems
 +
# requires population based search methods such as CMA-ES. There are 3 steps
 +
 
 +
Rough Description of Main Steps of Stochastic Ranking ([[#1|1]])
 +
# For each solution, the penalty is computed as the sum of all violated constraints (i.e. the constraint value is >= 0) <code> p = sum<sub>j</sub>(max(g<sub>j</sub>,0)) </code> as in the Penalty Method.
 +
# The solutions of the population are randomly ranked.
 +
# Always two adjacent solutions of the population are compared either based on their objective value or based on their penalty. Typically the comparison according to the penalty should have a higher probability of about 60%. The winner of the comparison obtains the better ranking position.
 +
# The comparision is repeated several times.
  
 
==Usage==
 
==Usage==
 +
 
-
 
-
 +
 
==Source Code==
 
==Source Code==
  
ToDo:Link to SVN
+
https://sourceforge.net/p/opendino/code/HEAD/tree/trunk/src/org/opendino/modules/optim/tools/ConstraintHandler.java
  
 
==References==
 
==References==
 
+
(<span id="1">1</span>) T. P. Runarsson and X. Yao, "Stochastic Ranking for Constrained Evolutionary Optimization", ''IEEE Transactions on Evolutionary Computation'', Vol. 4, No. 3, pp. 284-294, Sep. 2000.
-
 

Aktuelle Version vom 26. Oktober 2015, 22:00 Uhr

<< BACK TO MODULE OVERVIEW <<

Summary

Some optimization problems define objectives as well as constraints.

For example, one can set for the optimization problem ProblemTruss the weight of the truss to be minimized, while a constraint is set on the maximum stress and displacement of the truss.

This module aggregates objectives and constraints into a single output.

Properties

General

Algorithm deterministic (as no gradient handling is implemented)
Design Variables continuous variables, discrete or mixed variables are possible.
Objectives any number
Constraints any number
Boundaries not affected
Initial Search Region not affected
Typical X not affected
Initialization not required

Connections

Starting at his module One connection of type optimization
Ending at this module One connection of type optimization

Actions

Name Description
- -

Options

The options are currently described as "pop-up help".

Module Description

The result of an evaluation of a solution may contain objective values f and constraint values g:

While bjectives are to be minimized (min(f)), constraints are to be fulfilled (g =< 0).

0. No Constraint Handling

This option turns off the constraint handling. Objective values and constraints are not changed.

1. Delete Constraints

Deletes all constraints. This can be used if the goal is to minimize the objective function(s) only. The objective functions are not changed.

2. Penalty Method

To each objective function, a penalty (larger or equal to zero) is added. All violated constraints (i.e. the constraint value is >= 0) are summed and multiplied with a penalty factor p:

 penalized objective i = fi + sumj(max(gj,0))*p

Increasing the penalty factor p puts more weight on the constraints compared to the objectives.

3. Stochastic Ranking

Limitations:

  1. only for single objective problems
  2. requires population based search methods such as CMA-ES. There are 3 steps

Rough Description of Main Steps of Stochastic Ranking (1)

  1. For each solution, the penalty is computed as the sum of all violated constraints (i.e. the constraint value is >= 0) p = sumj(max(gj,0)) as in the Penalty Method.
  2. The solutions of the population are randomly ranked.
  3. Always two adjacent solutions of the population are compared either based on their objective value or based on their penalty. Typically the comparison according to the penalty should have a higher probability of about 60%. The winner of the comparison obtains the better ranking position.
  4. The comparision is repeated several times.

Usage

-

Source Code

https://sourceforge.net/p/opendino/code/HEAD/tree/trunk/src/org/opendino/modules/optim/tools/ConstraintHandler.java

References

(1) T. P. Runarsson and X. Yao, "Stochastic Ranking for Constrained Evolutionary Optimization", IEEE Transactions on Evolutionary Computation, Vol. 4, No. 3, pp. 284-294, Sep. 2000.