Class DispatcherJSIMschema

java.lang.Object
simDispatcher.DispatcherJSIMschema

public class DispatcherJSIMschema extends Object
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 Details

    • DispatcherJSIMschema

      public DispatcherJSIMschema(String absolutePath)
      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

      public DispatcherJSIMschema(File model)
      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

      public boolean solveModel() throws Exception
      Throws:
      Exception
    • 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 every refreshTempMeasures() 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

      public TempMeasure[] getTempMeasures()
      gets the temp measures
      Returns:
      the temp measures
    • 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

      public Simulation getSimulation()
    • testSimulationTime

      public static void testSimulationTime()
    • getOutputFile

      public File 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)