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
Modifier and TypeFieldDescriptionThe individual class the simulation is checked with while runningname of default db connection pool -
Constructor Summary
ConstructorDescriptionFWSimSolution
(FWSimSession aSession, FWSimSolution aFwSimSolution) Standard constructor taking a solutionElement
and aFWSimVarMap
After 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 solutionElement
and aFWSimVarMap
After Project initialization the different solution parts are set up to a working state. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLink
(SimVarLink aSimVarLink) void
addVariable
(FWSimVariable<?> aVariable) Not clear if this is senseful - be careful using itvoid
checkCondition
(Boolean aCheckResult, String aMessage) Called from inside the FWSimFieldContainer to log the initialization Errors.returns the project field maporg.jdom2.Element
org.jdom2.Element
getDynamicForm
(FWObservable aObservable) org.jdom2.Element
getEditFormXML
(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 pageint
org.jdom2.Element
getTitle()
getVariable
(String aID) returns variable from Projectlistvoid
init()
After standard constructor taking a solutionElement
and aFWSimVarMap
call order: initInterfaces initConstants initResources initModel initOutput After Project initialization the different solution parts are set up to a working state.boolean
void
removeLink
(SimVarLink aSimVarLink) void
removeSimFieldContainer
(FWSimFieldContainer aFieldContainer) void
removeVariable
(String aID) removes variable from project field list - be careful using itvoid
setCheckerClassName
(String aClassNameString) void
setInterface
(FWSimInterface<?> aInterface) void
Shows the description of the solution in external browsertoString()
returns the name - always ProjectConstantsorg.jdom2.Element
toXML()
void
update
(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 solutionElement
and aFWSimVarMap
After 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 solutionElement
and aFWSimVarMap
After 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 solutionElement
and aFWSimVarMap
call 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:
createVariables
in interfaceFWSimFieldContainer
- Returns:
- variables from the field map
- See Also:
-
addVariable
Not clear if this is senseful - be careful using it- Specified by:
addVariable
in interfaceFWSimFieldContainer
- See Also:
-
getVariable
returns variable from Projectlist- Specified by:
getVariable
in interfaceFWSimFieldContainer
- Returns:
- FWSimVariable for ID in Field Map
- See Also:
-
removeVariable
removes variable from project field list - be careful using it- Specified by:
removeVariable
in interfaceFWSimFieldContainer
- See Also:
-
getName
Always returns name: ProjectConstants - mostly used for module overview page- Specified by:
getName
in interfaceFWSimFieldContainer
- Returns:
- the Name of the component
- See Also:
-
getOrderNumber
public int getOrderNumber()- Specified by:
getOrderNumber
in interfaceFWSimFieldContainer
- Returns:
- number in the order of Components
- See Also:
-
getAuthor
- Returns:
-
getDescription
- Returns:
-
getTitle
- Returns:
-
getSkipSimulation
- Returns:
- the skipSimulation
-
getOutputVariables
- Specified by:
getOutputVariables
in interfaceFWSimFieldContainer
- Returns:
- FWSimVarables filtered - only output Variables
- See Also:
-
getInputVariables
returns empty ArrayList while there are no input variables for this object- Specified by:
getInputVariables
in interfaceFWSimFieldContainer
- Returns:
- FWSimVarables filtered - only input Variables
- See Also:
-
getFieldMap
returns the ProjectFieldMap- Specified by:
getFieldMap
in interfaceFWSimFieldContainer
- Returns:
- whole field map as created in createVariables()
- See Also:
-
toString
returns the name - always ProjectConstants -
getContentType
- Specified by:
getContentType
in 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:
toXML
in interfaceFWSimFieldContainer
- Returns:
- the SolutionElement
-
addLink
- Parameters:
aSimVarLink
-- Throws:
SimLinkInvalidException
-
removeLink
- Parameters:
aSimVarLink
-
-
removeSimFieldContainer
- Parameters:
aFieldContainer
-
-
getFrequence
- Specified by:
getFrequence
in interfaceFWSimFieldContainer
- Returns:
- the Frequence of the Container calling
- See Also:
-
getCreateFormXML
public org.jdom2.Element getCreateFormXML()- Specified by:
getCreateFormXML
in interfaceFWSimFieldContainer
- Returns:
- a xml element with all the settings of this component()
- See Also:
-
getEditFormXML
public org.jdom2.Element getEditFormXML(boolean aEnabled) - Specified by:
getEditFormXML
in 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:FWObserver
This method is called whenever the observed object is changed. An application calls an Observable object'snotifyObservers
method to have all the object's observers notified of the change.- Specified by:
update
in interfaceFWObserver
- Parameters:
aFormObservable
- the observable object.aArg
- an argument passed to thenotifyObservers
method.
-
showDescription
public void showDescription()Shows the description of the solution in external browser -
getVarMap
- Specified by:
getVarMap
in interfaceFWSimFieldContainer
- Returns:
- number in the order of Components
-
getSolutionElement
public org.jdom2.Element getSolutionElement()- Returns:
-
checkCondition
Description copied from interface:FWSimFieldContainer
Called from inside the FWSimFieldContainer to log the initialization Errors.- Specified by:
checkCondition
in interfaceFWSimFieldContainer
-
isConditionCheck
public boolean isConditionCheck()- Specified by:
isConditionCheck
in interfaceFWSimFieldContainer
-