Class FWSimulationSelector
java.lang.Object
net.simplace.sim.control.FWSimulationControlContainer
net.simplace.sim.control.FWSimulationSelector
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
WeightedLeastDifferenceSelector
Base class of the selectors of a calibration: a selector selects the best simulations of an iteration by
implementing
select(ResultSet). During the simulations the selector's inputs (e.g. simulated and observed
values, with an aggregation mode) are written by a FWSimCalibrationOutput (<id>DATA) to
the database; after the iteration they are read with an SQL statement and passed to select(ResultSet). The
selected simulations are written to the calibration outputs.- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FWSimIOAdapter.FREQUENCEfrequency of the selector's data output (attributefrequence, default DAILY)in GLOBAL mode: simulation ids by indexprotected StringSQL statement reading the data of the current iterationFields inherited from class FWSimulationControlContainer
iCache, iCals, iConstraint, iContainerElement, iControlMap, iFieldMap, iIdentifier, iInputMap, iInputs, iName, iParams, iSession, iSimulationMap -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for instantiation via reflection (documentation).FWSimulationSelector(org.jdom2.Element aSimulationSelectorElement, FWSimSession aSession) Creates the selector: registers the system inputs (simulation id, iteration, project id, simulation number, current date), reads theinputchildren (value, orsourcevariable withmode) and creates the data output of the selector. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates the SQL statement reading the data of the current iteration: in INDIVIDUAL mode for the current project ordered by simulation id, in GLOBAL mode for all projects ordered by simulation number and project.static FWSimulationSelectorcreateSimulationSelector(String aSimulationSelectorClassName) Factory method for documentation purposes: creates a selector without element and session.static FWSimulationSelectorcreateSimulationSelector(org.jdom2.Element aSimulationSelectorElement, FWSimSession aSession) Factory method: creates the selector of the class given in the attributeclassvia its constructor(Element, FWSimSession).protected abstract voidSelects the best simulations from the data of the iteration and stores them in the selected simulations of the control cache; to be implemented by the subclasses.voidselectSimulations(FWSimProject aProject) Selects the best simulations of the current iteration: commits the database, reads the data of the iteration with the select statement and callsselect(ResultSet)(skipped if the data cannot be read).Methods inherited from class FWSimulationControlContainer
addProcessTime, addVariable, checkCondition, evaluate, getContentType, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getInputVariables, getName, getOrderNumber, getOutputVariables, getVariable, getVarMap, init, isConditionCheck, readInputCalAndConstraint, removeVariable, setPropertyValue, toXMLMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FWSimFieldContainer
createVariables
-
Field Details
-
iFrequence
frequency of the selector's data output (attributefrequence, default DAILY) -
iSelectStatement
SQL statement reading the data of the current iteration -
iGlobalModeSimulationIDMap
-
-
Constructor Details
-
FWSimulationSelector
public FWSimulationSelector()Constructor for instantiation via reflection (documentation). -
FWSimulationSelector
Creates the selector: registers the system inputs (simulation id, iteration, project id, simulation number, current date), reads theinputchildren (value, orsourcevariable withmode) and creates the data output of the selector.Note: the element is read before its null check.
- Parameters:
aSimulationSelectorElement- theselectorelementaSession- the session
-
-
Method Details
-
createSelectStatement
protected void createSelectStatement()Creates the SQL statement reading the data of the current iteration: in INDIVIDUAL mode for the current project ordered by simulation id, in GLOBAL mode for all projects ordered by simulation number and project. -
createSimulationSelector
public static FWSimulationSelector createSimulationSelector(org.jdom2.Element aSimulationSelectorElement, FWSimSession aSession) Factory method: creates the selector of the class given in the attributeclassvia its constructor(Element, FWSimSession). Errors are logged.- Parameters:
aSimulationSelectorElement- theselectorelementaSession- the session- Returns:
- the selector, or
nullif it cannot be created
-
createSimulationSelector
Factory method for documentation purposes: creates a selector without element and session.Note: looks for a constructor
(Element, FWSimSolution), which the selectors do not have, so this method returnsnull.- Parameters:
aSimulationSelectorClassName- full class name of the selector- Returns:
- the selector, or
nullif it cannot be created
-
selectSimulations
Selects the best simulations of the current iteration: commits the database, reads the data of the iteration with the select statement and callsselect(ResultSet)(skipped if the data cannot be read). Then the project data of the selected simulations is loaded and each selected simulation (of this project, unless in GLOBAL mode) is written to the calibration outputs. Errors are logged.- Parameters:
aProject- the project (not used)
-
select
Selects the best simulations from the data of the iteration and stores them in the selected simulations of the control cache; to be implemented by the subclasses.- Parameters:
aResultSet- the data of the iteration, ornullif there is no select statement
-