Class EquidistantCalSimGenerator
- All Implemented Interfaces:
FWSimFieldContainer
The generator generates for each given parameter count many steps between min and max and creates for each parameter set a simulation.
An optional constraint prohibits the creation of simulations with invalid values that do not match the constraint rule.
Example
| <generator id="Generator" class="net.simplace.sim.control.generators.EquidistantCalSimGenerator">
| <cal id="TsumAnthesis" datatype="DOUBLE" target="vTempSumAnthesis">
| <input id="min" datatype="DOUBLE">0</input>
| <input id="max" datatype="DOUBLE">1500</input>
| <input id="count" datatype="INT">31</input>
| </cal>
| <cal id="TsumMaturity" datatype="DOUBLE" target="vTempSumMaturity">
| <input id="min" datatype="DOUBLE">1000</input>
| <input id="max" datatype="DOUBLE">2000</input>
| <input id="count" datatype="INT">21</input>
| </cal>
| <constraint rule="${Generator.TsumMaturity} > ${Generator.TsumAnthesis}+100">
| <identifier rule="TSumAnthesis(${Generator.TsumAnthesis})_TSumMaturity(${Generator.TsumMaturity})"/>
| </generator>
Notice
The number of generated simulation can be considerably high if you use many parameters, as the the parameters counts multiply. E. g. if you have 10 parameters and 50 counts the generator would generate \(50 \cdot 50 \cdot ...\cdot 50 = 50^{10} \approx 10^{17} \) parameter sets.
To illustrate this magnitude: just to store each set of 10 parameters we need 10 bytes. Storing all parameters, we need \(10^{18}\) bytes - or one million harddisks with 1TB capacity. And if a super fast computer would calculate hundred millions of simulations per second, we would still need \(10^9\) seconds or more than 30 years to calculate them.
- Author:
- Andreas Enders
-
Field Summary
Fields inherited from class FWSimulationGenerator
iContentType, iSimulationsMapFields inherited from class FWSimulationControlContainer
iCache, iCals, iConstraint, iContainerElement, iControlMap, iFieldMap, iIdentifier, iInputMap, iInputs, iName, iParams, iSession, iSimulationMap -
Constructor Summary
ConstructorsConstructorDescriptionEquidistantCalSimGenerator(org.jdom2.Element aGeneratorElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap, FWSimVariable.CONTENT_TYPE aContentType) -
Method Summary
Modifier and TypeMethodDescriptionHashMap<String, FWSimVariable<?>> Returns the field map (no own variables).voidgenerate(FWSimulationControlCache aCache, ResultSet aResultSet) Generates all combinations of the values of the calibration variables:countequidistant values betweenminandmax, or the givenvalues(double, int, date, boolean or string).voidinit()Nothing to initialize.Methods inherited from class FWSimulationGenerator
addSimulation, canUpdate, clearSimulations, createSimulationGenerator, finalize, getSimulation, getSimulationsListSize, initializeProject, reset, setFinished, setInitial, updateSimulations, writeSimulationMethods inherited from class FWSimulationControlContainer
addProcessTime, addVariable, checkCondition, evaluate, getContentType, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getInputVariables, getName, getOrderNumber, getOutputVariables, getVariable, getVarMap, isConditionCheck, readInputCalAndConstraint, removeVariable, setPropertyValue, toXML
-
Constructor Details
-
EquidistantCalSimGenerator
public EquidistantCalSimGenerator(org.jdom2.Element aGeneratorElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap, FWSimVariable.CONTENT_TYPE aContentType) - Parameters:
aGeneratorElement- thegeneratorelement with thecalchildrenaSession- the sessionaFieldMap- variables of the project dataaContentType- content type of the generated variables
-
-
Method Details
-
init
-
createVariables
Returns the field map (no own variables).- Specified by:
createVariablesin interfaceFWSimFieldContainer- Overrides:
createVariablesin classDefaultSimulationGenerator- Returns:
- the variables, keyed by name
- See Also:
-
generate
Generates all combinations of the values of the calibration variables:countequidistant values betweenminandmax, or the givenvalues(double, int, date, boolean or string). If both start and end date are calibrated with the same number of values, they are combined pairwise instead of crosswise. Each combination is added as simulation (subject to the constraint). Withcount1 the only value ismin.- Overrides:
generatein classDefaultSimulationGenerator- Parameters:
aCache- control cache of the runaResultSet- project data (not used)- Throws:
Exception- if start and end date have different numbers of values- See Also:
-