Package net.simplace.sim.control
Class FWSimulationGenerator
java.lang.Object
net.simplace.sim.control.FWSimulationControlContainer
net.simplace.sim.control.FWSimulationGenerator
- All Implemented Interfaces:
FWSimFieldContainer
- Direct Known Subclasses:
DefaultSimulationGenerator,SimpleSimulationGenerator
The simulation generator creates for existing project (
FWSimProject )
a range of simulations ( FWSimSimulation ). This abstract class has 2
implementations:
SimpleSimulationGenerator: Final class used for FWSimProject.PROJECT_MODE.SIMULATION and
FWSimVariable.CONTENT_TYPE.sim. It just delivers the (few) simulations in
the selected project.
DefaultSimulationGenerator: Class used for all FWSimProject.PROJECT_MODEs but
FWSimVariable.CONTENT_TYPE.res. Use this class to override and create own
SimGenerator plug-ins.
Method #generate(FWSimSimulation) has to be implemented in extending classes.- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FWSimVariable.CONTENT_TYPEContent Type - If Simulation or Resource Contentinitial field map as given by the createVariables()-Method in the SimComponent implementationFields inherited from class net.simplace.sim.control.FWSimulationControlContainer
iCache, iCals, iConstraint, iContainerElement, iControlMap, iFieldMap, iInputMap, iInputs, iName, iParams, iSession, iSimulationMap -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFWSimulationGenerator(org.jdom2.Element aControlContainerElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap, FWSimVariable.CONTENT_TYPE aContentType) Default constructor of the abstract class that has to be called from overriding classes. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddSimulation(FWSimVarMap aVarMap) Add simulation to iSimulationsListbooleanprotected voidClear the iSimulationsListstatic FWSimulationGeneratorcreateSimulationGenerator(org.jdom2.Element aContainerElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap, FWSimVariable.CONTENT_TYPE aContentType) factory method for Creation of the resource transformervoidfinalize()abstract voidgenerate(FWSimulationControlCache aControlCache, ResultSet aSimulationsResultSet) abstract method generate that is called from outside when the user calls:FWSimulationGenerator#updateSimulations(FWSimSimulation, String)protected FWSimSimulationgetSimulation(int index) Get simulation by indexprotected intGet the size of iSimulationsListprotected ResultSetinitializeProject(String aProjectID, FWSimulationControlCache aControlCache) voidreset()protected voidvoidupdateSimulations(FWSimulationControlCache aCache, String aProjectID, int aStartNumber) voidwriteSimulation(HashMap<String, FWSimVariable<?>> aSimulationMap) Methods inherited from class net.simplace.sim.control.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 java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.simplace.sim.util.FWSimFieldContainer
createVariables
-
Field Details
-
iSimulationsMap
initial field map as given by the createVariables()-Method in the SimComponent implementation -
iContentType
Content Type - If Simulation or Resource Content
-
-
Constructor Details
-
FWSimulationGenerator
public FWSimulationGenerator() -
FWSimulationGenerator
protected FWSimulationGenerator(org.jdom2.Element aControlContainerElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap, FWSimVariable.CONTENT_TYPE aContentType) Default constructor of the abstract class that has to be called from overriding classes.- Parameters:
aControlContainerElement-aSession-aFieldMap-aContentType-FWSimVariable.CONTENT_TYPE.resorFWSimVariable.CONTENT_TYPE.sim
-
-
Method Details
-
createSimulationGenerator
public static FWSimulationGenerator createSimulationGenerator(org.jdom2.Element aContainerElement, FWSimSession aSession, HashMap<String, FWSimVariable<?>> aFieldMap, FWSimVariable.CONTENT_TYPE aContentType) factory method for Creation of the resource transformer- Parameters:
aContainerElement-aSession-aFieldMap-aContentType-- Returns:
- the resource transformer
-
clearSimulations
protected void clearSimulations()Clear the iSimulationsList -
getSimulationsListSize
protected int getSimulationsListSize()Get the size of iSimulationsList- Returns:
- the count of simulations
-
getSimulation
Get simulation by index- Parameters:
index-- Returns:
- the simulation with the index. if not available null
-
addSimulation
Add simulation to iSimulationsList- Parameters:
aVarMap-- Returns:
- if the adding was successful
-
writeSimulation
- Parameters:
aSimulationMap-
-
updateSimulations
public List<FWSimSimulation> updateSimulations(FWSimulationControlCache aCache, String aProjectID, int aStartNumber) - Parameters:
aCache-aSelectedSimulation-aProjectID-aStartNumber-aMaxEndNumber-- Returns:
- the created Simulations
-
initializeProject
protected ResultSet initializeProject(String aProjectID, FWSimulationControlCache aControlCache) throws SQLException - Throws:
SQLException
-
generate
public abstract void generate(FWSimulationControlCache aControlCache, ResultSet aSimulationsResultSet) throws Exception abstract method generate that is called from outside when the user calls:FWSimulationGenerator#updateSimulations(FWSimSimulation, String)- Parameters:
aControlCache-aSimulationsResultSet-- Throws:
SQLExceptionException
-
canUpdate
- Parameters:
aProjectName-- Returns:
- the canUpdate
-
setFinished
protected void setFinished()- Parameters:
sets- SessionUpdate to false
-
setInitial
public void setInitial()- Parameters:
sets- SessionUpdate to true
-
finalize
public void finalize() -
reset
public void reset()
-