Package net.simplace.sim
Class FWSimSolution
java.lang.Object
net.simplace.sim.FWSimSolution
- All Implemented Interfaces:
FWObserver,FWSimFieldContainer
Contains whole information about:
Model-Template Interfaces for external data read and write Resource parameters Output configuration Constant Values
Within the Solution creation process the different parts of the simulation session are configured to a default configuration. Project simulations can overwrite these configurations namely
interfaces and outputs. The constant- or input variables are initialized in a hierarchical setting: Solution constants overwrite defaults Project constants overwrite solution constants Simulation
constants overwrite project constants IO-relations overwrite simulation constants (e.g. initial variables) in first simulation step
The solution contains as main part the model with its components and links between these and the resources and outputs.
Structure of solution.sol.xml file has to refer to the grammar of SimSolution.dtd
- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe individual class the simulation is checked with while runningname of default db connection pool -
Constructor Summary
ConstructorsConstructorDescriptionFWSimSolution(FWSimSession aSession, FWSimSolution aFwSimSolution) Standard constructor taking a solutionElementand aFWSimVarMapAfter Project initialization the different solution parts are set up to a working state.FWSimSolution(org.jdom2.Element aSimSolutionElement, FWSimVarMap aVarMap, String aSolutionName) Standard constructor taking a solutionElementand aFWSimVarMapAfter Project initialization the different solution parts are set up to a working state. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLink(SimVarLink aSimVarLink) voidaddVariable(FWSimVariable<?> aVariable) Not clear if this is senseful - be careful using itvoidcheckCondition(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.returns the project field maporg.jdom2.Elementorg.jdom2.ElementgetDynamicForm(FWObservable aObservable) org.jdom2.ElementgetEditFormXML(boolean aEnabled) returns the ProjectFieldMapreturns empty ArrayList while there are no input variables for this objectgetInterface(String aInterface) getName()Always returns name: ProjectConstants - mostly used for module overview pageintorg.jdom2.ElementgetTitle()getVariable(String aID) returns variable from Projectlistvoidinit()After standard constructor taking a solutionElementand aFWSimVarMapcall order: initInterfaces initConstants initResources initModel initOutput After Project initialization the different solution parts are set up to a working state.booleanvoidremoveLink(SimVarLink aSimVarLink) voidremoveSimFieldContainer(FWSimFieldContainer aFieldContainer) voidremoveVariable(String aID) removes variable from project field list - be careful using itvoidsetCheckerClassName(String aClassNameString) voidsetInterface(FWSimInterface<?> aInterface) voidShows the description of the solution in external browsertoString()returns the name - always ProjectConstantsorg.jdom2.ElementtoXML()voidupdate(FWObservable aFormObservable, Object aArg) This method is called whenever the observed object is changed.
-
Field Details
-
CONNECTION_POOL_DEFAULT
name of default db connection pool -
CHECKER_CLASS
The individual class the simulation is checked with while running
-
-
Constructor Details
-
FWSimSolution
Standard constructor taking a solutionElementand aFWSimVarMapAfter Project initialization the different solution parts are set up to a working state.- Parameters:
aSession-aFwSimSolution-
-
FWSimSolution
public FWSimSolution(org.jdom2.Element aSimSolutionElement, FWSimVarMap aVarMap, String aSolutionName) Standard constructor taking a solutionElementand aFWSimVarMapAfter Project initialization the different solution parts are set up to a working state.- Parameters:
aSimSolutionElement-aVarMap-aSolutionName-
-
-
Method Details
-
init
public void init()After standard constructor taking a solutionElementand aFWSimVarMapcall order: initInterfaces initConstants initResources initModel initOutput After Project initialization the different solution parts are set up to a working state.- Parameters:
aSimSolutionElement-aVarMap-aSolutionName-
-
getInterface
- Parameters:
aInterface-- Returns:
- list of the project ids
-
setInterface
- Parameters:
aInterface-
-
getModelTemplate
- Returns:
- list of the project ids
-
getResourceAdapters
- Returns:
- a collection of all resource adapters including transformer adapters
-
getOutputAdapters
- Returns:
- the Output Adapters
-
createVariables
returns the project field map- Specified by:
createVariablesin interfaceFWSimFieldContainer- Returns:
- variables from the field map
- See Also:
-
addVariable
Not clear if this is senseful - be careful using it- Specified by:
addVariablein interfaceFWSimFieldContainer- See Also:
-
getVariable
returns variable from Projectlist- Specified by:
getVariablein interfaceFWSimFieldContainer- Returns:
- FWSimVariable for ID in Field Map
- See Also:
-
removeVariable
removes variable from project field list - be careful using it- Specified by:
removeVariablein interfaceFWSimFieldContainer- See Also:
-
getName
Always returns name: ProjectConstants - mostly used for module overview page- Specified by:
getNamein interfaceFWSimFieldContainer- Returns:
- the Name of the component
- See Also:
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumberin interfaceFWSimFieldContainer- Returns:
- number in the order of Components
- See Also:
-
getAuthor
- Returns:
-
getDescription
- Returns:
-
getTitle
- Returns:
-
getSkipSimulation
- Returns:
- the skipSimulation
-
getOutputVariables
- Specified by:
getOutputVariablesin interfaceFWSimFieldContainer- Returns:
- FWSimVarables filtered - only output Variables
- See Also:
-
getInputVariables
returns empty ArrayList while there are no input variables for this object- Specified by:
getInputVariablesin interfaceFWSimFieldContainer- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getFieldMap
returns the ProjectFieldMap- Specified by:
getFieldMapin interfaceFWSimFieldContainer- Returns:
- whole field map as created in createVariables()
- See Also:
-
toString
returns the name - always ProjectConstants -
getContentType
- Specified by:
getContentTypein interfaceFWSimFieldContainer- Returns:
- number in the order of Components
- See Also:
-
setCheckerClassName
- Parameters:
aClassNameString- the checker class to perform checks
-
getCheckerClassName
- Returns:
- the level of checks performed
-
toXML
public org.jdom2.Element toXML()- Specified by:
toXMLin interfaceFWSimFieldContainer- Returns:
- the SolutionElement
-
addLink
- Parameters:
aSimVarLink-- Throws:
SimLinkInvalidException
-
removeLink
- Parameters:
aSimVarLink-
-
removeSimFieldContainer
- Parameters:
aFieldContainer-
-
getFrequence
- Specified by:
getFrequencein interfaceFWSimFieldContainer- Returns:
- the Frequence of the Container calling
- See Also:
-
getCreateFormXML
public org.jdom2.Element getCreateFormXML()- Specified by:
getCreateFormXMLin interfaceFWSimFieldContainer- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Specified by:
getEditFormXMLin interfaceFWSimFieldContainer- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getDynamicForm
- Parameters:
aObservable-- Returns:
- the dynamic form element
-
update
Description copied from interface:FWObserverThis method is called whenever the observed object is changed. An application calls an Observable object'snotifyObserversmethod to have all the object's observers notified of the change.- Specified by:
updatein interfaceFWObserver- Parameters:
aFormObservable- the observable object.aArg- an argument passed to thenotifyObserversmethod.
-
showDescription
public void showDescription()Shows the description of the solution in external browser -
getVarMap
- Specified by:
getVarMapin interfaceFWSimFieldContainer- Returns:
- number in the order of Components
-
getSolutionElement
public org.jdom2.Element getSolutionElement()- Returns:
-
checkCondition
Description copied from interface:FWSimFieldContainerCalled from inside the FWSimFieldContainer to log the initialization Errors.- Specified by:
checkConditionin interfaceFWSimFieldContainer
-
isConditionCheck
public boolean isConditionCheck()- Specified by:
isConditionCheckin interfaceFWSimFieldContainer
-