Klasse ShrinkParameterspaceIterator
- Alle implementierten Schnittstellen:
FWSimFieldContainer
Documentation
In each iteration step, the range of a parameter is shrunk by cShrinkFactor and centered around the the actual value of the parameter.
Initial step
Values for each cal variable's min and max or sigma and mean are taken from initial configuration.
Subsequent steps
If the cal variable has a value, calculated by a simulation and selected by a selector in the previous iteration, then the new range will be centered around this value. Otherwise the new range will be centered around the midpoint of the previous range.
If cDrift is set to true then the new range can exceed the initial min and max values. Otherwise the new range will be cut to fit inside the original range. If it is false, then min and max properties have to be give, even if you wan to use only mean and sigma.
Calculation for iteration step \(i \gt 1\): \[ \begin{eqnarray} mean_i & = & \begin{cases} parametervalue & \text{if parametervalue is set} \\ \frac{max_{i-1} + min_{i-1}}{2} & \text{else} \end{cases} \\ radius_i & = & \frac{max_{i-1} - min_{i-1}}{2} \cdot cShrinkFactor \\ min_i & = & \begin{cases} mean_i - radius_i & \text{if } cDrift \text{ is true} \\ \max(mean_i - radius_i,min_1) & \text{else} \end{cases} \\ max_i & = & \begin{cases} mean_i + radius_i & \text{if } cDrift \text{ is true} \\ \min(mean_i + radius_i,max_1) & \text{else} \end{cases} \\ sigma_i & = & sigma_{i-1} \cdot cShrinkFactor \end{eqnarray} \]Stop condition
The iterator runs maximum maxCount times. Iteration will stop earlier, if the constraint rule becomes false.
Example
Defining and configuring an iterator
| <iterator id="Iterator" class="net.simplace.sim.control.iterators.ShrinkParameterspaceIterator">
| <input id="cShrinkFactor" datatype="DOUBLE">.5</input>
| <input id="cDrift" datatype="BOOLEAN">false</input>
| <input id="maxCount" datatype="INT">5</input>
| <constraint description="" rule="${Selector.BestErrorValue} > 46" />
| <cal id="SLA" datatype="DOUBLE" target="vSLA">
| <input id="min" datatype="DOUBLE">0.01</input>
| <input id="max" datatype="DOUBLE">0.1</input>
| <input id="sigma" datatype="DOUBLE">0.0025</input>
| <input id="mean" datatype="DOUBLE">0.02</input>
| </cal>
| <cal id="LUE" datatype="DOUBLE" target="vLUE">
| <input id="min" datatype="DOUBLE">1</input>
| <input id="max" datatype="DOUBLE">5</input>
| <input id="sigma" datatype="DOUBLE">0.21</input>
| <input id="mean" datatype="DOUBLE">3.0</input>
| </cal>
| </iterator>
Iterator calculates min/max/mean/sigma for two parameters vSLA and vLUE.
Initial interval for vLUE is from 1.0 to 5.0. In each interation step, the size of the interval will be half of the previous size. E.g. if after iteration step 1 the selected LUE will be 3.7, then the new intervall will range from 2.7 to 4.7. If the selected LUE after iteration step 2 will be 3.8, then the new intervall will range from 3.3 to 4.3 etc... If the selected LUE after iteration step 2 will be 4.6, then the new interval will range from 4.1 to 5.0, as the designed upper bound 5.1 is bigger than initial max value 5.0.
Using the iterator by a generator
| <generator id="Generator" class="net.simplace.client.simulation.lap.generators.RandomSimGenerator"> | <input id="cCount" datatype="INT">100</input> | <cal id="LUE" datatype="DOUBLE" target="vLUE"> | <input id="min" datatype="DOUBLE" source="vLUE_min" /> | <input id="max" datatype="DOUBLE" source="vLUE_max" /> | <input id="sigma" datatype="DOUBLE" source="Iterator.LUE.sigma" /> | <input id="mean" datatype="DOUBLE" source="Iterator.LUE.mean" /> | <input id="distribution" datatype="CHAR">Normal</input> | </cal> | <cal id="SLA" datatype="DOUBLE" target="vSLA"> | <input id="min" datatype="DOUBLE" source="vSLA_min" /> | <input id="max" datatype="DOUBLE" source="vSLA_max" /> | <input id="distribution" datatype="CHAR">Uniform</input> | </cal> | </generator>
The generator will generate 100 simulations in each, chosing vLUE from a normal distribution centered around the mean and sigma values provided by the iterator. As sigma becomes smaller, the range of the values will be smaller.
Notice that for vSLA min and max are independent from the iterator, so in each step the values will be randomly chosen from the same range.
- Autor:
- G. Krauss
-
Feldübersicht
Von Klasse geerbte Felder net.simplace.sim.control.FWSimulationIterator
iInputMap, iMaxRunCountVon Klasse geerbte Felder net.simplace.sim.control.FWSimulationControlContainer
iCache, iCals, iConstraint, iContainerElement, iControlMap, iFieldMap, iIdentifier, iInputs, iName, iParams, iSession, iSimulationMap -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungShrinkParameterspaceIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidinit()The model initialization function.protected booleanVon Klasse geerbte Methoden net.simplace.sim.control.FWSimulationIterator
createSimulationIterator, getIterationCount, getMaxIterationCountVon Klasse geerbte Methoden net.simplace.sim.control.FWSimulationControlContainer
addProcessTime, addVariable, checkCondition, evaluate, getContentType, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getInputVariables, getName, getOrderNumber, getOutputVariables, getVariable, getVarMap, isConditionCheck, readInputCalAndConstraint, removeVariable, setPropertyValue, toXML
-
Konstruktordetails
-
ShrinkParameterspaceIterator
public ShrinkParameterspaceIterator(org.jdom2.Element aSimulationIteratorElement, FWSimSession aSession) - Parameter:
aSimulationIteratorElement-aSession-
-
-
Methodendetails
-
createVariables
- Angegeben von:
createVariablesin SchnittstelleFWSimFieldContainer- Setzt außer Kraft:
createVariablesin KlasseFWSimulationIterator- Gibt zurück:
- variables from the field map
-
init
public void init()Beschreibung aus Klasse kopiert:FWSimulationControlContainerThe model initialization function. Will be called only once, before running the model using process().- Setzt außer Kraft:
initin KlasseFWSimulationIterator
-
iterate
- Setzt außer Kraft:
iteratein KlasseDefaultSimulationIterator- Parameter:
aProjectID-- Gibt zurück:
- if the simulation should go on simulating
- Siehe auch:
-