Package jmt.engine.simDispatcher

Examples of jmt.engine.simDispatcher.Dispatcher_jSIMschema


      } catch (Exception e) {
        JOptionPane.showMessageDialog(null, "File exception", "Error", JOptionPane.ERROR_MESSAGE);
      }
      simulationFile.deleteOnExit();
      XMLWriter.writeXML(simulationFile, (CommonModel) simd);
      simulator = new Dispatcher_jSIMschema(simulationFile);
      if (simd.getMaximumDuration().longValue() > 0) {
        timer = new PATimerThread(simulator, simd.getMaximumDuration().doubleValue());
        timer.start();
      }
      try {
View Full Code Here


  /**
   * This method starts simualtion, given simulation XML file
   * @param simulationFile file where simulation model is stored
   */
  public void startSimulation(File simulationFile) {
    simulator = new Dispatcher_jSIMschema(simulationFile);
    // ----------- Francesco D'Aquino ---------------
    if (sd.isAnimationEnabled()) {
      //if it is the first time create a new simStateChecker
      simStateChecker = new SimulationStateChecker((Mediator) gui, simulator);

View Full Code Here

      Transformer aTransformer = tranFactory.newTransformer()
      Source src = new DOMSource(doc2)
      Result dest = new StreamResult(temp)
      aTransformer.transform(src, dest)
     
      Dispatcher_jSIMschema dispatcher = new Dispatcher_jSIMschema(temp);
      // Sets simulation seed if required
      if (options.containsKey(OPTION_SEED)) {
        try {
          dispatcher.setSimulationSeed(Long.parseLong(options.get(OPTION_SEED)));
        } catch (NumberFormatException ex) {
          System.err.println("Invalid simulation seed. Should be a number.");
          System.exit(1);
        }
      }
     
      if (options.containsKey(OPTION_MAXTIME)) {
        try {
          dispatcher.setSimulationMaxDuration(Long.parseLong(options.get(OPTION_MAXTIME)) * 1000);
        } catch (NumberFormatException ex) {
          System.err.println("Invalid maximum simulation time. Should be a number.");
          System.exit(1);
       
      }
     
      // Starts the simulation
      dispatcher.solveModel();
     
      File output = dispatcher.getOutputFile();
     
      File result = new File(args[1]+"-result.jsim");
     
      copyFile(output, result);
      output.delete();
View Full Code Here

    if (!model.isFile()) {
      System.err.print("Invalid model file: " + model.getAbsolutePath());
      System.exit(1);
    }
   
    Dispatcher_jSIMschema dispatcher = new Dispatcher_jSIMschema(model);
    // Sets simulation seed if required
    if (args.length > 1) {
      try {
        dispatcher.setSimulationSeed(Long.parseLong(args[1]));
      } catch (NumberFormatException ex) {
        System.err.println("Invalid simulation seed");
        System.exit(1);
      }
    }
   
    // Starts the simulation
    dispatcher.solveModel();
   
    File output = dispatcher.getOutputFile();
   
    System.out.println("Output file stored in path: " + output.getAbsolutePath());
  }
View Full Code Here

    disp.solveModel();
  }

  public static void test_dispatcher_jSIMschema(String path) {

    Dispatcher_jSIMschema disp = new Dispatcher_jSIMschema(path);
    disp.automaticSimulationSeed();
    disp.solveHandlingExceptions();

  }
View Full Code Here

public class TestLDService {
  public static final String filename = "LDtest.jmt";
  public static final String path = "D:\\";

  public static void main(String[] args) throws Exception {
    Dispatcher_jSIMschema simulator = new Dispatcher_jSIMschema("" + path + filename);
    simulator.solveModel();
    String resfilename = path + "res_sim_" + filename + ".xml";
    StoredResultsModel srm = new StoredResultsModel();
    XMLResultsReader.parseXML(XMLReader.loadXML(resfilename), srm);
    ResultsWindow res = new ResultsWindow(srm);
    res.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
View Full Code Here

TOP

Related Classes of jmt.engine.simDispatcher.Dispatcher_jSIMschema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.