Class SimplaceWrapper
- Direct Known Subclasses:
JavaSimplaceWrapper
JavaSimplaceWrapper and the language specific wrappers simplace for R and Python). It works
with a single current session:
- create the wrapper with the directories
prepareSession(String, String)with solution and optional project- either
run()for the whole project, or create simulations withcreateSimulation(Object[][])and run them withrunSimulations(boolean)or step by step withstep()/stepAll() - read the results of MEMORY outputs with
getResult(String, String) shutDown()at the end
Object[][] of pairs {name, value}.
Limitation of several simulations created with createSimulation(Object[][]) (#465): they form one
project. The resources (input data, transformers) are read once with the values of the first simulation, and
file names of inputs and outputs (e.g. ${_WORKDIR_}/weather/${vLocation}.csv) are resolved once with
them, too. So all simulations get the same input data and write into the same output files, even if a parameter
used in a file name (like vLocation or projectid) differs. Model parameters (e.g. crop
parameters, management dates) can differ freely. For different input data either run the simulations one after
another (new prepareSession(String, String) or resetSimulationQueue() and
runSimulations(boolean, boolean) with doUpdateResources), or use a project file with one line
per location. createSimulation(Object[][]) logs a warning if a parameter occurs in a file name of an
interface and differs from the first simulation.
- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FWSimSessionthe current (last prepared) sessionper queue entry: if the simulation has been initializedprotected intnumber of simulations created withcreateSimulation(Object[][])(used as simulation number)protected List<FWSimSimulation> the simulations created or generated for stepwise or queued runsprotected booleanif the simulations have been initialized (outputs, resources, generation) -
Constructor Summary
ConstructorsConstructorDescriptionCreates the wrapper without setting directories.SimplaceWrapper(String aWorkDir, String aOutputDir) Creates the wrapper and sets work and output directory; projects and data directory are the work directory.SimplaceWrapper(String aWorkDir, String aOutputDir, String aProjectsDir, String aDataDir) Creates the wrapper and sets the directories of the engine (created if missing). -
Method Summary
Modifier and TypeMethodDescriptioncreateSimulation(Object[][] aParameterMap) Creates a simulation of the current session with the given parameters and adds it to the queue, so several simulations can be run together (seerunSimulations(boolean)).String[]Returns the results of a MEMORY output after the simulations have been run.String[]static intvoidinitializeSpecificSimulation(int aSimulationQueueIndex) Initializes a simulation of the queue before its parameters are set or it is stepped; on the first call all simulations are initialized first (seeinitSimulations()).voidInitializes the simulations for stepwise runs: if the queue is empty, the simulations of the first project are generated and put into the queue; then the simulations are registered at the outputs, the output writers are started and the resources are updated.prepareSession(String aProject, String aSolution) Prepares a session for solution and project and makes it the current session.prepareSession(String aProject, String aSolution, Object[][] aParameterMap) Prepares a session for solution and project with additional parameters and makes it the current session (seeprepareSession(String, String)).voidregisterModelListener(FWSimulationListener aModelListener) Registers a listener for the simulation, project and iteration events of the current session.voidregisterOutputListener(FWSimOutputListener aOutputListener) Registers a listener that is notified on every output call of the current session.voidremoveModelListener(FWSimulationListener aModelListener) Removes a simulation listener.voidremoveOutputListener(FWSimOutputListener aOutputListener) Removes an output listener.voidClears the queue of simulations and the result caches of the memory outputs.voidrun()Runs all projects of the current session (seeFWSimSession.run()); the session is finalized afterwards.voidDeprecated.voidrunSimulations(boolean doSelectSolution) Runs all simulations of the queue, seerunSimulations(boolean, boolean).voidrunSimulations(boolean doSelectSolution, boolean doUpdateResources) Runs all simulations of the queue (created withcreateSimulation(Object[][])) and clears the queue.voidsetAllSimulationValues(Object[][][] aParameterMap) Sets the values of all simulations of the queue.voidsetCheckLevel(String aCheckLevel) Sets the check level of the engine; to be called before preparing a session.voidsetDirectories(String aWorkDir, String aOutputDir, String aProjectsDir, String aDataDir) Sets the directories of the engine;nullleaves a directory unchanged.static voidsetLogLevel(String aLogLevel) Sets the log level of the whole process (static, applies to all sessions).voidsetProjectLines(Integer[] aProjectLines) Sets the lines of the project data to read; to be called before preparing a session.voidsetProjectLines(String aProjectLines) Sets the lines of the project data to read; to be called before preparing a session.voidsetSimulationValues(int aSimulationQueueIndex, Object[][] aParameterMap) Sets values in the variable map of a simulation of the queue (initializing it first if necessary).voidsetSimulationValues(Object[][] aParameterMap) Sets values in the variable map of the first simulation of the queue.static voidsetSlotCount(int aSlotCount) Sets the maximum number of simulations run in parallel, i.e.voidsetSpecificSimulationValues(int aSimulationQueueIndex, Object[][][] aParameterMap) Sets the values for one simulation from a list of value maps (one per simulation).voidshutDown()Finalizes the current session (writes remaining outputs, closes files) and clears the queue and the project lines; has to be called at the end.step()Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).step(int aStepCount) Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepAll()Calculates one step of all simulations of the queue, seestepAll(Object[][][], String[], int, boolean).stepAll(int aStepCount) Calculates steps of all simulations of the queue, seestepAll(Object[][][], String[], int, boolean).Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean).Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean).Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean).Runs all simulations of the queue stepwise, not in parallel, seestepAll(Object[][][], String[], int, boolean).stepAll(Object[][][] aParameterMap, String[] aOutputFilterArray, int aStepCount, boolean aParallelized) Runs all simulations of the queue stepwise: for each simulation the values are set, the given number of steps is calculated and the variable map is returned.Calculates one step of all simulations of the queue, seestepAll(Object[][][], String[], int, boolean).Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean).stepSpecific(int aSimulationQueueIndex) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepSpecific(int aSimulationQueueIndex, int aStepCount) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap, int aStepCount) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap, String[] aOutputFilterArray) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap, String[] aOutputFilterArray, int aStepCount) Runs a simulation of the queue stepwise: sets the values, calculates the given number of steps and returns the variable map after the last step.stepSpecific(int aSimulationQueueIndex, String[] aOutputFilterArray) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).stepSpecific(int aSimulationQueueIndex, String[] aOutputFilterArray, int aStepCount) Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int).
-
Field Details
-
isSimulationInitialized
protected boolean isSimulationInitializedif the simulations have been initialized (outputs, resources, generation) -
iCurrentSession
the current (last prepared) session -
iSimulationsQueue
the simulations created or generated for stepwise or queued runs -
iSimulationsCount
protected int iSimulationsCountnumber of simulations created withcreateSimulation(Object[][])(used as simulation number) -
iInitializedSimulations
-
-
Constructor Details
-
SimplaceWrapper
Creates the wrapper and sets the directories of the engine (created if missing).- Parameters:
aWorkDir- work directoryaOutputDir- output directoryaProjectsDir- projects directory, ornullfor the work directoryaDataDir- data directory, ornullfor the work directory
-
SimplaceWrapper
-
SimplaceWrapper
public SimplaceWrapper()Creates the wrapper without setting directories. Only for test classes and for further wrappers in the same process after the directories were set once (e.g. one wrapper per REST session); otherwise give work and output directory.
-
-
Method Details
-
setDirectories
public void setDirectories(String aWorkDir, String aOutputDir, String aProjectsDir, String aDataDir) Sets the directories of the engine;nullleaves a directory unchanged.- Parameters:
aWorkDir- work directory, may benullaOutputDir- output directory, may benullaProjectsDir- projects directory, may benullaDataDir- data directory, may benull
-
getDirectories
- Returns:
- the directories of the engine: work, output, projects and data directory
-
prepareSession
Prepares a session for solution and project and makes it the current session. Thenrun()runs it, or the simulations can be stepped (seestep()).- Parameters:
aProject- project file, ornullto run the solution onlyaSolution- solution file- Returns:
- the new session, or the previous one if the files cannot be read (the error is logged)
-
prepareSession
Prepares a session for solution and project with additional parameters and makes it the current session (seeprepareSession(String, String)). The project lines set before are used.- Parameters:
aProject- project file, ornullto run the solution onlyaSolution- solution fileaParameterMap- parameters as pairs{name, value}overriding solution variables, may benull- Returns:
- the new session, or the previous one if the files cannot be read (the error is logged)
-
run
Runs all projects of the current session (seeFWSimSession.run()); the session is finalized afterwards.- Throws:
Exception- if the run fails
-
run
Deprecated.Runs all projects of the current session.The project lines cannot be applied here, as the project data are already read when the session is prepared; a given value is ignored with a warning. Use
setProjectLines(String)beforeprepareSession(String, String)and thenrun().- Parameters:
aProjectlines- project lines as string (e.g."1,2,5,9-100"), ignored- Throws:
Exception- if the run fails
-
createSimulation
Creates a simulation of the current session with the given parameters and adds it to the queue, so several simulations can be run together (seerunSimulations(boolean)). Only solution variables should be passed. All simulations of the queue use the input data and output files of the first one (see the class description); a warning is logged once per parameter if a parameter used in a file name of an interface differs from the first simulation.- Parameters:
aParameterMap- parameters as pairs{name, value}, may benull- Returns:
- the created simulation
- Throws:
Exception- if a value cannot be set
-
runSimulations
Runs all simulations of the queue (created withcreateSimulation(Object[][])) and clears the queue. On the first call (or withdoUpdateResources) the output writers are started and the project is generated; the resources are updated with the first simulation.- Parameters:
doSelectSolution- if a selection should be done (passed on, currently not used)doUpdateResources-trueto initialize again before running- Throws:
IllegalStateException- if the queue is emptyException- if running fails
-
runSimulations
Runs all simulations of the queue, seerunSimulations(boolean, boolean).- Parameters:
doSelectSolution- if a selection should be done (currently not used)- Throws:
Exception- if running fails
-
initializeSpecificSimulation
public void initializeSpecificSimulation(int aSimulationQueueIndex) Initializes a simulation of the queue before its parameters are set or it is stepped; on the first call all simulations are initialized first (seeinitSimulations()).- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)
-
resetSimulationQueue
public void resetSimulationQueue()Clears the queue of simulations and the result caches of the memory outputs. -
getSimulationIDs
- Returns:
- the ids of all simulations in the queue
-
getResult
Returns the results of a MEMORY output after the simulations have been run.- Parameters:
aName- name of the output (must use a MEMORY interface)aSimulationID- id of a simulation, ornullfor all simulations- Returns:
- the data, or
nullif there is no output with this name or it is no memory output (the error is logged)
-
setSimulationValues
Sets values in the variable map of a simulation of the queue (initializing it first if necessary). An invalid index is ignored.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aParameterMap- values as pairs{name, value}
-
setSimulationValues
Sets values in the variable map of the first simulation of the queue.- Parameters:
aParameterMap- values as pairs{name, value}
-
setSpecificSimulationValues
Sets the values for one simulation from a list of value maps (one per simulation).- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aParameterMap- one array of pairs{name, value}per simulation
-
setAllSimulationValues
Sets the values of all simulations of the queue.- Parameters:
aParameterMap- one array of pairs{name, value}per simulation
-
stepSpecific
public DataContainer stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap, String[] aOutputFilterArray, int aStepCount) throws Exception Runs a simulation of the queue stepwise: sets the values, calculates the given number of steps and returns the variable map after the last step. On the first call outputs, resources and project are initialized. When the simulation ends, it is finished (once) andnullis returned; further calls returnnullwithout calculating (unlikestepAll(Object[][][], String[], int, boolean), which returns the last state marked withDataContainer.isLast()). With a step count of 0 only the values are set and the current state is returned.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aParameterMap- values as pairs{name, value}set before the steps, may benullaOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended or the index is invalid - Throws:
Exception- if a step fails
-
stepSpecific
Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
stepSpecific
Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
stepSpecific
public DataContainer stepSpecific(int aSimulationQueueIndex, String[] aOutputFilterArray) throws Exception Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aOutputFilterArray- names of the variables to return, ornullfor all- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
stepSpecific
public DataContainer stepSpecific(int aSimulationQueueIndex, String[] aOutputFilterArray, int aStepCount) throws Exception Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
stepSpecific
public DataContainer stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap) throws Exception Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aParameterMap- values as pairs{name, value}set before the steps- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
stepSpecific
public DataContainer stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap, int aStepCount) throws Exception Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aParameterMap- values as pairs{name, value}set before the stepsaStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
stepSpecific
public DataContainer stepSpecific(int aSimulationQueueIndex, Object[][] aParameterMap, String[] aOutputFilterArray) throws Exception Runs a simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aSimulationQueueIndex- index of the simulation in the queue (0-based)aParameterMap- values as pairs{name, value}set before the stepsaOutputFilterArray- names of the variables to return, ornullfor all- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
public DataContainer step(Object[][] aParameterMap, String[] aOutputFilterArray, int aStepCount) throws Exception Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- values as pairs{name, value}set before the stepsaOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aOutputFilterArray- names of the variables to return, ornullfor all- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- values as pairs{name, value}set before the steps- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- values as pairs{name, value}set before the stepsaStepCount- number of steps to calculate- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
step
Runs the first simulation of the queue stepwise, seestepSpecific(int, Object[][], String[], int). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- values as pairs{name, value}set before the stepsaOutputFilterArray- names of the variables to return, ornullfor all- Returns:
- the variables after the steps, or
nullif the simulation has ended - Throws:
Exception- if a step fails
-
initSimulations
Initializes the simulations for stepwise runs: if the queue is empty, the simulations of the first project are generated and put into the queue; then the simulations are registered at the outputs, the output writers are started and the resources are updated.- Throws:
Exception- if generating or initializing failsMissingSimResourceException- if a resource is missing
-
stepAll
public DataContainer[] stepAll(Object[][][] aParameterMap, String[] aOutputFilterArray, int aStepCount, boolean aParallelized) throws Exception Runs all simulations of the queue stepwise: for each simulation the values are set, the given number of steps is calculated and the variable map is returned. A simulation that ends is finished (once) and its result is marked as last (DataContainer.setLast(boolean)); it is not calculated beyond its end date, further calls return its last state again, marked as last.- Parameters:
aParameterMap- one array of pairs{name, value}per simulation, may benullaOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculateaParallelized-trueto step the simulations in parallel, with at mostgetSlotCount()threads (like a normal run); the results and outputs are the same as stepping them one after another- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
public DataContainer[] stepAll(Object[][][] aParameterMap, String[] aOutputFilterArray, int aStepCount) throws Exception Runs all simulations of the queue stepwise, not in parallel, seestepAll(Object[][][], String[], int, boolean).- Parameters:
aParameterMap- one array of pairs{name, value}per simulation, may benullaOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculate- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
Calculates one step of all simulations of the queue, seestepAll(Object[][][], String[], int, boolean).- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
Calculates steps of all simulations of the queue, seestepAll(Object[][][], String[], int, boolean).- Parameters:
aStepCount- number of steps to calculate- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
Calculates one step of all simulations of the queue, seestepAll(Object[][][], String[], int, boolean).- Parameters:
aOutputFilterArray- names of the variables to return, ornullfor all- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aOutputFilterArray- names of the variables to return, ornullfor allaStepCount- number of steps to calculate- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- one array of pairs{name, value}per simulation- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- one array of pairs{name, value}per simulationaStepCount- number of steps to calculate- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
stepAll
public DataContainer[] stepAll(Object[][][] aParameterMap, String[] aOutputFilterArray) throws Exception Runs all simulations of the queue stepwise, seestepAll(Object[][][], String[], int, boolean). Omitted arguments mean: no values set, all variables returned, one step.- Parameters:
aParameterMap- one array of pairs{name, value}per simulationaOutputFilterArray- names of the variables to return, ornullfor all- Returns:
- one result per simulation
- Throws:
Exception- if the initialization fails
-
registerOutputListener
Registers a listener that is notified on every output call of the current session.- Parameters:
aOutputListener- the listener
-
removeOutputListener
Removes an output listener.- Parameters:
aOutputListener- the listener
-
registerModelListener
Registers a listener for the simulation, project and iteration events of the current session.- Parameters:
aModelListener- the listener
-
removeModelListener
Removes a simulation listener.- Parameters:
aModelListener- the listener
-
shutDown
public void shutDown()Finalizes the current session (writes remaining outputs, closes files) and clears the queue and the project lines; has to be called at the end. Errors are logged. -
setCheckLevel
Sets the check level of the engine; to be called before preparing a session.- Parameters:
aCheckLevel- name of the check level: OFF, LAZY, INTENSE, STRICT, CUSTOM or ONLY
-
setLogLevel
Sets the log level of the whole process (static, applies to all sessions). Language bindings should use this method instead of accessing the logger directly.- Parameters:
aLogLevel- name of the log level, from least to most verbose: FATAL, ERROR, WARN, INFO, DEBUG, TRACE (case insensitive)- Throws:
IllegalArgumentException- if the name is not a log level
-
setSlotCount
public static void setSlotCount(int aSlotCount) Sets the maximum number of simulations run in parallel, i.e. the number of processor cores used (static, applies to all sessions). Language bindings should use this method instead of accessing the engine directly.- Parameters:
aSlotCount- number of parallel simulation slots, at least 1- Throws:
IllegalArgumentException- if the count is less than 1
-
getSlotCount
public static int getSlotCount()- Returns:
- the maximum number of simulations run in parallel (see
setSlotCount(int))
-
setProjectLines
Sets the lines of the project data to read; to be called before preparing a session.- Parameters:
aProjectLines- lines as string, e.g."1,2,5,9-100"
-
setProjectLines
Sets the lines of the project data to read; to be called before preparing a session.- Parameters:
aProjectLines- the line numbers, ornullfor all
-
setProjectLines(String)beforeprepareSession(String, String)andrun()