net.simplace.simulation.wrapper.SimplaceWrapper
This class serves as wrapper to access the SIMPLACE Model Engine (net.simplace.simulation) 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);
public SimplaceWrapper();
// Protected Instance Variables
protected boolean isSimulationInitialized;
protected FWSimSession iCurrentSession;
protected FWSimSimulation iPreparedSimulation;
// Public Instance Methods 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.simulation.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
FWSimSimulation createSimulation(Object[][] aParameterMap, boolean
doQueueSimulationsUp) 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
Note: only solution defined constants (v...) should be passed to the system
- aParameterMap giving the parameterizations for this simulation
- doQueueSimulationsUp if the simulation should be put to the prepared project to make it possible
to run them in parallel
returns the simulation created from parameters passed to the method
public void
runSimulations(boolean doUpdateResources, 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
SimplaceWrapper.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
SimplaceWrapper.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
SimplaceWrapper.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
SimplaceWrapper.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
SimplaceWrapper.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 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(
FWSimModelListener aModelListener);
Model listener gets Model Event with the current Model
public void
removeModelListener(
FWSimModelListener aModelListener);
Model listener gets Model Event with the current Model
public void finalize(); // Overrides java.lang.Object
Has to be called at the end.
// Inner Classes
public class SimplaceWrapper.DataContainer
}
Extended by: JavaSimplaceWrapper