示例#1
0
 /** Shutdown and release engine. Save any state if necessary */
 protected synchronized void releaseEngine() {
   if (solverModel != null) {
     solverModel.terminate();
     solverModel = null;
     log.log(Level.INFO, "Engine released");
   }
 }
示例#2
0
  /** Create and connect PSEngine */
  protected void hookupEngine(File data, File solverConfig) {
    try {
      PSUtil.loadLibraries();
    } catch (UnsatisfiedLinkError e) {
      log.log(
          Level.SEVERE,
          "Cannot load Europa libraries. Please make the "
              + "dynamic libraries are included in LD_LIBRARY_PATH "
              + "(or PATH for Windows)",
          e);
      System.exit(1);
    }

    // loadFile(dataFile);

    solverModel = new SolverModel();
    if (data != null && solverConfig != null) {
      solverModel.configure(data, solverConfig, 0, 100);
      solverModel.start();
    }

    log.log(Level.INFO, "Engine started");
  }