Package net.simplace.sim
Klasse FWSimEngine
java.lang.Object
net.simplace.sim.FWSimEngine
Engine is started with the main configuration xml file having no need of GUI-configuration or classes
Singleton implementation
Needs Solution.sol.xml-File. Structure is defined by the SimSolution.dtd.
For Project-Simulation a Project.proj.xml-File is needed defined by the SimProject.dtd.
First the
FWSimSolution is created with a call with the actionCommand "createSolution".
Within the provided FWSimVarMap the parameter "solution" points to the solution.sol.xml-File
Then the provided FWSimVarMap could point to the project.proj.xml-File within parameter
"project". For Test mode no project file is provided. But "createProject" call is needed in all cases.
Three types of simulations are supported:
FWSimProject.PROJECT_MODE.SIMULATION: Test simulations without project or simple project runs for given project
configuration
FWSimProject.PROJECT_MODE.SENSITIVITY: Project creates List of FWSimSimulation
via plug-in FWSimulationGenerator and runs them accordingly
FWSimProject.PROJECT_MODE.CALIBRATION: Like SENSITIVITY but additional FWSimulationSelector selecting
one simulation that fits most to the plug-in selector.
simulations for each given
A call of "run" command starts the process.
FWSimEngine can be used to register Listeners to it: FWSimOutputListener and FWSimulationListener.- Autor:
- Andreas Enders
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic intnumber of simulations that are queued at once -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidModelViewControler architecture -FWSimEnginesignifies the controller to be calledvoidcall(int aClickCount, String aFunction, HashMap<String, FWSimVariable<?>> aParameterMap, FWSimSession.APPLICATION_MODE aAppMode) voidfinalizeSession(FWSimSession aCurrentSession) finalizes one seesionstatic Stringstatic FWSimEngineReturns a Reference to the Identity instance (if there is no one yet it creates one)static Stringstatic Stringstatic intstatic Stringstatic FWSimSessionprepareSession(String aProjectFileName, String aSolutionFileName) Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.static FWSimSessionprepareSession(String aProjectFileName, String aSolutionFileName, Object[][] aParameters) Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.static FWSimSessionprepareSession(String aProject, String aSolution, Object[][] aParameters, Integer[] aLinesToBeRead, FWSimSession.APPLICATION_MODE aApplicationMode) Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.static FWSimSessionprepareSession(String aProjectFileName, String aSolutionFileName, FWSimSession.APPLICATION_MODE aApplicationMode) Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.prepareSession(HashMap<String, FWSimVariable<?>> aParameterMap, Object[][] aParameters, FWSimSession.APPLICATION_MODE aApplicationMode) prepareSession(org.jdom2.Element aSolutionElement, FWSimVarMap aVarMap, Object[][] aParameters, String aSessionName, FWSimSession.APPLICATION_MODE aApplicationMode, FileData aSolutionFile) static FWSimSessionregisterSession(FWSimSession aSessionO) static FWSimSessionregisterSolution(FWSimSolution aSolutionO, FWSimSession.APPLICATION_MODE aApplicationMode) static voidreset()resets the whole engine to be able to reinitialize it.static FWSimSessionrunProjects(String aProject, String aSolution) Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.static FWSimSessionEnsemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.static voidsetAppMode(FWSimSession.APPLICATION_MODE aAppMode) voidsetCheckLevel(FWCheckHelper.CHECK_LEVEL aCheckLevel) static voidsetDataDir(String aPathString) static voidsetOutputDir(String aPathString) static voidsetProjectsDir(String aPathString) static voidsetSlotCount(int aSlotCount) static voidsetWorkDir(String aPathString) voidshutDown()Shutdown the Thread pool if it's finished
-
Felddetails
-
MAX_SIMULATION_COUNT
public static int MAX_SIMULATION_COUNTnumber of simulations that are queued at once
-
-
Methodendetails
-
getInstance
Returns a Reference to the Identity instance (if there is no one yet it creates one)- Gibt zurück:
- the singleton instance
-
call
ModelViewControler architecture -FWSimEnginesignifies the controller to be called- Parameter:
aClickCount-aActionCommand-- Löst aus:
Exception
-
call
public void call(int aClickCount, String aFunction, HashMap<String, FWSimVariable<?>> aParameterMap, FWSimSession.APPLICATION_MODE aAppMode) throws Exception- Parameter:
aClickCount- of mouse buttonaFunction- as action command etc.aParameterMap- to pass predefined parameters to the softwareaAppMode-- Löst aus:
Exception
-
prepareSession
public static FWSimSession prepareSession(String aProjectFileName, String aSolutionFileName) throws IOException Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.- Parameter:
aProjectFileName-aSolutionFileName-- Gibt zurück:
- the prepared Session
- Löst aus:
IOException- when a file could not be found.
-
prepareSession
public static FWSimSession prepareSession(String aProjectFileName, String aSolutionFileName, Object[][] aParameters) throws IOException Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.- Parameter:
aProjectFileName-aSolutionFileName-- Gibt zurück:
- the prepared Session
- Löst aus:
IOException- when a file could not be found.
-
prepareSession
public static FWSimSession prepareSession(String aProjectFileName, String aSolutionFileName, FWSimSession.APPLICATION_MODE aApplicationMode) throws IOException Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.- Parameter:
aProjectFileName-aSolutionFileName-aApplicationMode-- Gibt zurück:
- the prepared Session
- Löst aus:
IOException- when a file could not be found.
-
prepareSession
public static FWSimSession prepareSession(String aProject, String aSolution, Object[][] aParameters, Integer[] aLinesToBeRead, FWSimSession.APPLICATION_MODE aApplicationMode) throws IOException Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.- Parameter:
aProject-aLinesToBeRead-aApplicationMode-aSolutionFileName-- Gibt zurück:
- the prepared Session
- Löst aus:
IOException- when a file could not be found.
-
runProjects
public static FWSimSession runProjects(String aProject, String aSolution, HashMap<String, String> aSplitMap) Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode. Please make sure if you want to use the SplitList to add ${sessionid} or ${projectid} to your output files to prevent them from being overwritten!- Parameter:
aSplitMap- (500000)aProjectFileName-aSolutionFileName-- Gibt zurück:
- runs all projects of the session and returns it.
-
runProjects
Ensemble of all needed calls to run a whole model specified in the solution-file and project-file if no project file name is given, the solution will be taken as default project and simulation will be run once in test mode.- Parameter:
aProject-aSolution-- Gibt zurück:
- runs all projects of the session and returns it.
-
prepareSession
public FWSimSession prepareSession(HashMap<String, FWSimVariable<?>> aParameterMap, Object[][] aParameters, FWSimSession.APPLICATION_MODE aApplicationMode) throws IOException- Parameter:
aParameterMap-aApplicationMode-- Gibt zurück:
- the FWSimSolution object filled with the parameters from XML in file
- Löst aus:
IOException
-
prepareSession
public FWSimSession prepareSession(org.jdom2.Element aSolutionElement, FWSimVarMap aVarMap, Object[][] aParameters, String aSessionName, FWSimSession.APPLICATION_MODE aApplicationMode, FileData aSolutionFile) - Parameter:
aSolutionElement-aVarMap-aSessionName-aApplicationMode-aSolutionFile-- Gibt zurück:
- the FWSimSolution object filled with the parameters from XML in file
-
getCheckLevel
-
setCheckLevel
-
setWorkDir
- Parameter:
aPathString-
-
getWorkDir
- Gibt zurück:
- the work directory
-
setOutputDir
- Parameter:
aPathString-
-
getOutputDir
- Gibt zurück:
- the output dir
-
setProjectsDir
- Parameter:
aPathString-
-
getProjectsDir
- Gibt zurück:
- the Projects dir
-
setDataDir
- Parameter:
aPathString-
-
getDataDir
- Gibt zurück:
- the Data dir
-
registerSolution
public static FWSimSession registerSolution(FWSimSolution aSolutionO, FWSimSession.APPLICATION_MODE aApplicationMode) - Parameter:
aSolutionO-aApplicationMode-aSolutionFile-- Gibt zurück:
- the created session
-
registerSession
- Parameter:
aSessionO-- Gibt zurück:
- the created session
-
shutDown
public void shutDown()Shutdown the Thread pool if it's finished -
reset
public static void reset()resets the whole engine to be able to reinitialize it. -
getSlotCount
public static int getSlotCount()- Gibt zurück:
- number of free slots on this computer (processes)
-
setSlotCount
public static void setSlotCount(int aSlotCount) - Parameter:
aSlotCount- number of free slots on this computer (parallel processes)
-
setAppMode
- Parameter:
aAppMode-
-
getSessions
- Gibt zurück:
- the current session (if only one)
-
finalizeSession
finalizes one seesion- Parameter:
aCurrentSession-
-
getAppMode
- Gibt zurück:
- the Application Mode
-