net.simplace.sim.wrapper.SimplaceWrapper
This class serves as wrapper to access the SIMPLACE Model Engine (net.simplace.sim) from other applications.
It can further be wrapped by system or language specific wrappers like the
See also: JavaSimplaceWrapper, SimplaceWrapper.R, PythonSimplaceWrapper.py, MatlabSimplaceWrapper.mat
public class SimplaceWrapper {
// Public Constructors
public SimplaceWrapper(String aWorkDir, String aOutputDir, String
aProjectsDir, String aDataDir);
public SimplaceWrapper(String aWorkDir, String aOutputDir);
public SimplaceWrapper();
// Protected Instance Variables
protected boolean isSimulationInitialized;
protected FWSimSession iCurrentSession;
protected List iSimulationsQueue;
protected FWCheckHelper.CHECK_LEVEL iCheckLevel;
// Public Instance Methods public void
setDirectories(String aWorkDir, String aOutputDir, String
aProjectsDir, String aDataDir);
Sets directories used by solution
- aWorkDir
- aOutputDir
- aProjectsDir
- aDataDir
public String[]
getDirectories();
Sets directories used by solution
- aWorkDir
- aOutputDir
- aProjectsDir
- aDataDir
public
FWSimSession prepareSession(String aProjectPath, String aSolutionPath);
prepares the project or solution to use it with next methods. CurrentSession instance variable
is set and used. Just call
net.simplace.sim.wrapper.SimplaceWrapper.run() to start the simulation. You can also use "step" to
start the first step of the first simulation.
- aProjectPath - optional if project should be used
- aSolutionPath - required
returns the newly created session.
public void run() throws Exception;
runs the prepared project or solution - not to be used without calling prepare Project before
public void
run(String aProjectlines) throws Exception;
runs the prepared project or solution - not to be used without calling prepare Project before
- aProjectlines option to set project lines as a string ("1,2,5,9-100,111") the according
lines in the project data file are evaluated - others are ignored.
public
FWSimSimulation createSimulation(Object[][] aParameterMap)
throws Exception;
Pass a parameter map with key (name of variable) and value (value of variable) to the system.
- not to be used without calling prepare Project before
simulation is put into the prepared project to make possible to run them in parallel
Note: only solution defined constants (v...) should be passed to the system
- aParameterMap giving the parameterizations for this simulation
returns the simulation created from parameters passed to the method
public void
runSimulations(boolean doSelectSolution, boolean
doUpdateResources) throws Exception;
Calculates the last prepared simulation (only one!) or, depending on your way to create the solutions,
the whole queue of solutions. For the ladder you can choose, if a selection should be done. Therefore
it is necessary to specify the selection variant in the project file.
- not to be used without calling prepare Project before
- doUpdateResources if resources should be reinitialized before calculating a new simulation
- doSelectSolution if resources should be reinitialized before calculating a new simulation
public void
runSimulations(boolean doSelectSolution) throws Exception;
Calculates the last prepared simulation (only one!) or, depending on your way to create the solutions,
the whole queue of solutions. For the ladder you can choose, if a selection should be done. Therefore
it is necessary to specify the selection variant in the project file.
- not to be used without calling prepare Project before
- doUpdateResources if resources should be reinitialized before calculating a new simulation
- doSelectSolution if resources should be reinitialized before calculating a new simulation
public void resetSimulationQueue();
resets the simulation queue
public String[] getSimulationIDs();
returns List of all IDs of all simulations in the queue.
public
DataContainer getResult(String aName, String aSimulationID);
Used for getting results of the performed simulations. You have to use
- prepareProject and optional
- createSimulation AND necessarily
- runSimulations or run
before!
- aName of the MEMORY type output
- aSimulationID of the simulation
returns an object array containing the cached data
public void
setSimulationValues(Object[][] aParameterMap);
Sets the parameters of the first simulations varmap
- aParameterMap Map (String,Object) of key value pairs to be used in the VarMap for this simulation day(s)
public
DataContainer step(Object[][] aParameterMap, String[]
aOutputFilterArray, int aStepCount) throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is usable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aParameterMap Map (String,Object) of key value pairs to be used in the VarMap for this simulation day(s)
- aOutputFilterArray only these Keys will be included in the output array
- aStepCount count of steps to be calculated before returning the result
returns an object array containing the var map data of this step
public
DataContainer step() throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
returns an object array containing the var map data of this step
public
DataContainer step(int aStepCount) throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aStepCount number of steps calculated
returns an object array containing the var map data of this step
public
DataContainer step(String[] aOutputFilterArray) throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aOutputFilterArray only these Keys will be included in the output array
returns an object array containing the var map data of this step
public
DataContainer step(String[] aOutputFilterArray, int aStepCount)
throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aOutputFilterArray only these Keys will be included in the output array
- aStepCount count of steps to be calculated before returning the result
returns an object array containing the var map data of this step
public
DataContainer step(Object[][] aParameterMap) throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aParameterMap Map (String,Object) of key value pairs to be used in the VarMap for this simulation day(s)
returns an object array containing the var map data of this step
public
DataContainer step(Object[][] aParameterMap, int aStepCount)
throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aParameterMap Map (String,Object) of key value pairs to be used in the VarMap for this simulation day(s)
- aStepCount count of steps to be calculated before returning the result
returns an object array containing the var map data of this step
public
DataContainer step(Object[][] aParameterMap, String[]
aOutputFilterArray) throws Exception;
Used running the simulation stepwise. Only the last created or the first simulation in the first project is useable.
You have to run
- prepareProject and optional
- createSimulation
before!
- aParameterMap Map (String,Object) of key value pairs to be used in the VarMap for this simulation day(s)
- aOutputFilterArray only these Keys will be included in the output array
returns an object array containing the var map data of this step
public void
registerOutputListener(
FWSimOutputListener aOutputListener);
Output listener gets Output Event with the current VarMap
public void
removeOutputListener(
FWSimOutputListener aOutputListener);
Output listener gets Output Event with the current VarMap
public void
registerModelListener(
FWSimulationListener aModelListener);
Model listener gets Model Event with the current Model
public void
removeModelListener(
FWSimulationListener aModelListener);
Model listener gets Model Event with the current Model
public void shutDown();
Has to be called at the end.
public void
setCheckLevel(String aCheckLevel);
- aCheckLevel the checkLevel to set,
can be OFF, LAZY, INTENSE, CUSTOM or ONLY
public void
setProjectLines(String aProjectLines);
- aProjectLines the projectLines to read while reading project data file.
public void
setProjectLines(Integer[] aProjectLines);
- aProjectLines the projectLines to read while reading project data file.
}
Extended by: JavaSimplaceWrapper