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 net.simplace.sim.util.FWSimVarMap the parameter "solution" points to the solution.sol.xml-File
Then the provided net.simplace.sim.util.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 java.util.List of FWSimSimulation
via plug-in net.simplace.sim.control.FWSimulationGenerator and runs them accordingly
FWSimProject.PROJECT_MODE.CALIBRATION: Like SENSITIVITY but additional net.simplace.sim.control.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: net.simplace.sim.event.FWSimOutputListener and net.simplace.sim.event.FWSimulationListener.
public final class FWSimEngine {
// Class Variables
public static int MAX_SIMULATION_COUNT;
// Class Methods public static
FWSimEngine getInstance();
Returns a Reference to the Identity instance (if there is no one yet it
creates one)
returns the singleton instance
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.
- aProjectFileName
- aSolutionFileName
returns the prepared Session
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.
- aProjectFileName
- aSolutionFileName
- aApplicationMode
returns the prepared Session
public static
FWSimSession prepareSession(String aProjectFileName, String
aSolutionFileName, 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.
- aProjectFileName
- aSolutionFileName
- aLinesToBeRead
- aApplicationMode
returns the prepared Session
public static
FWSimSession runProjects(String aProjectFileName, String
aSolutionFileName, HashMap 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!
- aProjectFileName
- aSolutionFileName
- aSplitMap (500000)
returns runs all projects of the session and returns it.
public static
FWSimSession runProjects(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.
- aProjectFileName
- aSolutionFileName
returns runs all projects of the session and returns it.
public static void
setWorkDir(String aPathString);
public static String getWorkDir();
returns the work directory
public static void
setOutputDir(String aPathString);
public static String getOutputDir();
returns the output dir
public static void
setProjectsDir(String aPathString);
public static String getProjectsDir();
returns the Projects dir
public static void
setDataDir(String aPathString);
public static String getDataDir();
returns the Data dir
public static void reset();
resets the whole engine to be able to reinitialize it.
public static int getSlotCount();
returns number of free slots on this computer (processes)
public static void
setSlotCount(int aSlotCount);
- aSlotCount number of free slots on this computer (parallel processes)
// Public Instance Methods public void
call(int aClickCount, String aActionCommand) throws Exception;
ModelViewControler architecture -
net.simplace.sim.FWSimEngine signifies the controller to be called
- aClickCount
- aActionCommand
public void
call(int aClickCount, String aFunction, HashMap aParameterMap,
FWSimSession.APPLICATION_MODE aAppMode) throws Exception;
- aClickCount of mouse button
- aFunction as action command etc.
- aParameterMap to pass predefined parameters to the software
- aAppMode
public
FWSimSession prepareSession(HashMap aParameterMap,
FWSimSession.APPLICATION_MODE aApplicationMode) throws IOException;
- aParameterMap
- aApplicationMode
returns the FWSimSolution object filled with the parameters from XML in file
public
FWSimSession prepareSession(Element aSolutionElement,
FWSimVarMap aVarMap, String aSessionName,
FWSimSession.APPLICATION_MODE aApplicationMode,
FileData aSolutionFile);
- aSolutionElement
- aVarMap
- aSessionName
- aApplicationMode
- aSolutionFile
returns the FWSimSolution object filled with the parameters from XML in file
public void shutDown();
Shutdown the Thread pool if it's finished
public List getSessions();
returns the current session (if only one)
public void
finalizeSession(
FWSimSession aCurrentSession);
finalizes one seesion
}
Returned by: getInstance()