Class DispatcherJSIMschema
java.lang.Object
simDispatcher.DispatcherJSIMschema
Receives the absolute path of a xml file which describes the model using the
SIMmodeldefinition.xsd schema.
The simulation results, at the end, are converted and
are inserted in the original file.
- Author:
- Stefano Omini Modified by Bertoli Marco Modified by Francesco D'Aquino
-
Constructor Summary
ConstructorsConstructorDescriptionDispatcherJSIMschema(File model) This constructor receives the absolute path of the xml file containing the model to be solved.DispatcherJSIMschema(String absolutePath) This constructor receives the absolute path of the xml file containing the model to be solved. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanabortMeasure(int index) voidabortMeasureAtRefresh(int measureIndex) Aborts a measure at next measure refresh...voidBy invoking this method, simulation will generate a random simulation seeddoubleallows to know the state of simulation.voidForces the simulation into the "finished" state without requiring it to have started.Returns the output file.gets the temp measuresbooleanTells if simulation was finishedbooleanisPaused()Tells if simulation was pausedbooleanTells if simulation was startedbooleanbooleanpauseSim()Pauses the simulationvoidPrints on System.out the temp values of measures that have not finished yetvoidPauses the simulation, refreshes temp measures and then restarts simulationbooleanResumes the simulationvoidsetParametricStep(int parametricStep) voidsetSimulationMaxDuration(long durationMillis) Sets simulation max duration timevoidsetSimulationSeed(long seed) Specifies the seed to be used in the simulation.voidsetTerminalSimulation(boolean isTerminalSimulation) booleanbooleanstatic voidstatic void
-
Constructor Details
-
DispatcherJSIMschema
This constructor receives the absolute path of the xml file containing the model to be solved. The model must be described using the SIMmodeldefinition.xsd schema- Parameters:
absolutePath- absolute path of the xml file containing the model to be solved
-
DispatcherJSIMschema
This constructor receives the absolute path of the xml file containing the model to be solved. The model must be described using the SIMmodeldefinition.xsd schema- Parameters:
model- the xml file containing the model to be solved
-
-
Method Details
-
automaticSimulationSeed
public void automaticSimulationSeed()By invoking this method, simulation will generate a random simulation seed -
setSimulationSeed
public void setSimulationSeed(long seed) Specifies the seed to be used in the simulation.- Parameters:
seed- the simulation seed
-
setSimulationMaxDuration
public void setSimulationMaxDuration(long durationMillis) Sets simulation max duration time- Parameters:
durationMillis- maximum time in milliseconds
-
solveModel
-
solveHandlingExceptions
public boolean solveHandlingExceptions() -
isStarted
public boolean isStarted()Tells if simulation was started- Returns:
- true iff simulation was started
-
isFinished
public boolean isFinished()Tells if simulation was finished- Returns:
- true iff simulation was finished
-
isPaused
public boolean isPaused()Tells if simulation was paused- Returns:
- true iff simulation was paused
-
checkSimProgress
public double checkSimProgress()allows to know the state of simulation. Value is calculated at everyrefreshTempMeasures()to avoid pausing simulation two times.- Returns:
- the percentage of progress (= number of computed confidence intervals / total number of required confidence intervals)
-
refreshTempMeasures
public void refreshTempMeasures()Pauses the simulation, refreshes temp measures and then restarts simulation -
getTempMeasures
-
abortAllMeasures
public boolean abortAllMeasures() -
killSimulation
public boolean killSimulation() -
forceFinished
public void forceFinished()Forces the simulation into the "finished" state without requiring it to have started. Called when the simulation failed to initialise (e.g. LoadException in SimLoader) so that threads polling isFinished() are unblocked. -
abortMeasure
public boolean abortMeasure(int index) -
abortMeasureAtRefresh
public void abortMeasureAtRefresh(int measureIndex) Aborts a measure at next measure refresh... Used to avoid to stop simulation too frequently Author: Bertoli Marco -
printTempMeasures
public void printTempMeasures()Prints on System.out the temp values of measures that have not finished yet -
pauseSim
public boolean pauseSim()Pauses the simulation- Returns:
- true if the operation was successful, false otherwise (for example simulation not started or already finished)
-
restartSim
public boolean restartSim()Resumes the simulation- Returns:
- true if the operation was successful, false otherwise (for example simulation not started or already finished)
-
getSimulation
-
testSimulationTime
public static void testSimulationTime() -
getOutputFile
Returns the output file.- Returns:
- the output XML file with the results of the simulation.
-
testSolution
public static void testSolution() -
setTerminalSimulation
public void setTerminalSimulation(boolean isTerminalSimulation) -
setParametricStep
public void setParametricStep(int parametricStep)
-