예제 #1
0
파일: Run.java 프로젝트: traviolia/simlib
 public static void main(String[] args) throws Exception {
   if (args.length < 1) System.out.println("Usage: java desmoj.util.Run <parameterfile>.xml");
   else {
     System.out.println("*** DESMO-J Simulation Runner ***");
     System.out.println("* Reading experiment specification from " + args[0]);
     Document d = DocumentReader.getInstance().readDoc(args[0]);
     Run run = new Run();
     run.readFromNode(d.getDocumentElement());
     ExperimentRunner runner = run.getExperimentRunner();
     long startMillis = System.currentTimeMillis();
     runner.start();
     long stopMillis = System.currentTimeMillis();
     System.out.println(
         "* Simulation took " + (stopMillis - startMillis) / 1000.0 + " seconds.\n");
   }
 }
예제 #2
0
 /** Loads the DOM node representing the document currently open in the experiment launcher */
 void loadDocNode() {
   try {
     Document d = DocumentReader.getInstance().readDoc(filename);
     docNode = d.getDocumentElement();
     if (docNode.getNodeName().equals("run")) {
       runsBatch = false;
       readExperimentRunFromNode(docNode);
     } else if (docNode.getNodeName().equals("batch")) {
       runsBatch = true;
     }
     experimentGUI.resetGUI(
         filename, runsBatch, modelAccessPoints, expAccessPoints, model.getName());
   } catch (Exception e) {
     e.printStackTrace();
     filename = null;
     docNode = null;
     runsBatch = false;
   }
 }