Exemplo n.º 1
0
  public ATNEngine() {
    // load properties file containing ATN model parameter values
    propertiesConfig = new Properties();
    try {
      propertiesConfig.load(new FileInputStream("src/atn/SimJobConfig.properties"));
    } catch (FileNotFoundException ex) {
      Logger.getLogger(ATNEngine.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
      Logger.getLogger(ATNEngine.class.getName()).log(Level.SEVERE, null, ex);
    }

    /*
    Read in non-std variables used for running sim jobs
    */
    if (LOAD_SIM_TEST_PARAMS) { // False by default, set to true only in main of this class
      GameServer.getInstance();
      SpeciesType.loadSimTestNodeParams(Constants.ECOSYSTEM_TYPE);
      SpeciesType.loadSimTestLinkParams(Constants.ECOSYSTEM_TYPE);
    }
    // Above is not needed SimJobManager does this
  }
  public SimJobConverge(String config, int timesteps) {

    GameServer.getInstance(); // load species information
    /* read in experimental variables only used for running simulation jobs*/
    if (SimJob.DFLT_USE_SIMTESTNODE_VALS) {
      SpeciesType.loadSimTestNodeParams(Constants.ECOSYSTEM_TYPE);
      SpeciesType.loadSimTestLinkParams(Constants.ECOSYSTEM_TYPE);
    }

    jobMgr = new SimJobManager();
    simJob = new SimJob(config, timesteps);
    jobMgr.setSimJob(simJob);

    try {
      jobId = jobMgr.runSimJob();
    } catch (Exception ex) {
      Logger.getLogger(SimJobConverge.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
      status = jobMgr.getStatus();
    }
  }