Package jmt.analytical

Examples of jmt.analytical.SolverMultiClosedChow


      } else {
        System.out.println("Wrong input!!");
      }
    }
   
    solver = new SolverMultiClosedChow(classes, stations, pop);
    algorithm = "Chow";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.print(algorithm+",");
View Full Code Here


    System.gc(); System.gc(); System.gc(); System.gc();
    System.gc(); System.gc(); System.gc(); System.gc();
    System.gc(); System.gc(); System.gc(); System.gc();
    System.gc(); System.gc(); System.gc(); System.gc();
   
    SolverMulti solver = new SolverMultiClosedChow(classes, stations, pop);
    String algorithm = "Chow";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.println(algorithm);
      System.out.println(solver);
     
      System.out.print(algorithm+",");
      //System.out.println(algorithm);
      //System.out.println("-------------------------------------");
      //System.out.println(queueLength(stations, classes, solver));
      long stop = System.currentTimeMillis();
      System.out.print(((stop-start)/(double)1000) + ",");
      //System.out.println("Elapsed time (ms) = " + (stop - start));
      start = 0; stop = 0;
     
      long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
      solver = null;
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
     
      System.out.print(((mem0-mem1)/(double)1024) + ",");
      System.out.print((mem0/(double)1024) + "\n");
     
//      System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
//      System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
//      System.out.println("-------------------------------------");
      mem0 = 0; mem1 = 0;
    } else {
      System.out.println("Wrong input!!");
    }

    solver = new SolverMultiClosedBardSchweitzer(classes, stations, pop);
    algorithm = "Bard-Schweitzer";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.println(algorithm);
      System.out.println(solver);
     
      System.out.print(algorithm+",");
      //System.out.println(algorithm);
      //System.out.println("-------------------------------------");
      //System.out.println(queueLength(stations, classes, solver));
      long stop = System.currentTimeMillis();
      System.out.print(((stop-start)/(double)1000) + ",");
      //System.out.println("Elapsed time (ms) = " + (stop - start));
      start = 0; stop = 0;
     
      long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
      solver = null;
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
     
      System.out.print(((mem0-mem1)/(double)1024) + ",");
      System.out.print((mem0/(double)1024) + "\n");
//      System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
//      System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
//      System.out.println("-------------------------------------");
      mem0 = 0; mem1 = 0;
    } else {
      System.out.println("Wrong input!!");
    }

    solver = new SolverMultiClosedAQL(classes, stations, pop);
    algorithm = "AQL";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.println(algorithm);
      System.out.println(solver);
     
      System.out.print(algorithm+",");
      //System.out.println(algorithm);
      //System.out.println("-------------------------------------");
      //System.out.println(queueLength(stations, classes, solver));
      long stop = System.currentTimeMillis();
      System.out.print(((stop-start)/(double)1000) + ",");
      //System.out.println("Elapsed time (ms) = " + (stop - start));
      start = 0; stop = 0;
     
      long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
      solver = null;
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
     
      System.out.print(((mem0-mem1)/(double)1024) + ",");
      System.out.print((mem0/(double)1024) + "\n");
//      System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
//      System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
//      System.out.println("-------------------------------------");
      mem0 = 0; mem1 = 0;
    } else {
      System.out.println("Wrong input!!");
    }

    solver = new SolverMultiClosedLinearizer(classes, stations, pop, false);
    algorithm = "Linearizer";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.println(algorithm);
      System.out.println(solver);
     
      System.out.print(algorithm+",");
      //System.out.println(algorithm);
      //System.out.println("-------------------------------------");
      //System.out.println(queueLength(stations, classes, solver));
      long stop = System.currentTimeMillis();
      System.out.print(((stop-start)/(double)1000) + ",");
      //System.out.println("Elapsed time (ms) = " + (stop - start));
      start = 0; stop = 0;
     
      long mem0 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
      solver = null;
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      System.gc(); System.gc(); System.gc(); System.gc();
      long mem1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
     
      System.out.print(((mem0-mem1)/(double)1024) + ",");
      System.out.print((mem0/(double)1024) + "\n");
//      System.out.println("Memory Usage (KB) = " + ((mem0 - mem1)/(double)1024));
//      System.out.println("Memory Usage w/o diff (KB) = " + ((mem0)/(double)1024));
//      System.out.println("-------------------------------------");
      mem0 = 0; mem1 = 0;
    } else {
      System.out.println("Wrong input!!");
    }

    solver = new SolverMultiClosedLinearizer(classes, stations, pop, true);
    algorithm = "DeSouza-Muntz Linearizer";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.println(algorithm);
      System.out.println(solver);
     
      System.out.print(algorithm+",");
      //System.out.println(algorithm);
View Full Code Here

      mem0 = 0; mem1 = 0;
    } else {
      System.out.println("Wrong input!!");
    }
   
    solver = new SolverMultiClosedChow(classes, stations, pop);
    algorithm = "Chow";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.print(algorithm+",");
View Full Code Here

    } else {
      System.out.println("Wrong input!!");
    }

    start = System.currentTimeMillis();
    SolverMultiClosedChow mClosedChow = new SolverMultiClosedChow(classes, stations, pop);
    if (mClosedChow.input(name, type, servt, visits)) {
      String algorithm = "Chow";
      mClosedChow.solve();
      models.put(algorithm, mClosedChow);
      long stop = System.currentTimeMillis();
      elapsedTimes.put(algorithm, ((stop - start)/(double)1000));
    } else {
      System.out.println("Wrong input!!");
View Full Code Here

    } else {
      System.out.println("Wrong input!!");
    }

    start = System.currentTimeMillis();
    SolverMultiClosedChow mClosedChow = new SolverMultiClosedChow(classes, stations, pop);
    if (mClosedChow.input(name, type, servt, visits)) {
      String algorithm = "Chow";
      mClosedChow.solve();
      models.put(algorithm, mClosedChow);
      long stop = System.currentTimeMillis();
      elapsedTimes.put(algorithm, ((stop - start)/(double)1000));
    } else {
      System.out.println("Wrong input!!");
View Full Code Here

    } else {
      System.out.println("Wrong input!!");
    }

    start = System.currentTimeMillis();
    SolverMultiClosedChow mClosedChow = new SolverMultiClosedChow(classes, stations, pop);
    if (mClosedChow.input(name, type, servt, visits)) {
      String algorithm = "Chow";
      mClosedChow.solve();
      models.put(algorithm, mClosedChow);
      long stop = System.currentTimeMillis();
      elapsedTimes.put(algorithm, ((stop - start)/(double)1000));
    } else {
      System.out.println("Wrong input!!");
View Full Code Here

    } else {
      System.out.println("Wrong input!!");
    }

    start = System.currentTimeMillis();
    SolverMultiClosedChow mClosedChow = new SolverMultiClosedChow(classes, stations, pop);
    if (mClosedChow.input(name, type, servt, visits)) {
      String algorithm = "Chow";
      mClosedChow.solve();
      models.put(algorithm, mClosedChow);
      long stop = System.currentTimeMillis();
      elapsedTimes.put(algorithm, ((stop - start)/(double)1000));
    } else {
      System.out.println("Wrong input!!");
View Full Code Here

    Map<String, Double> elapsedTimes = new LinkedHashMap<String, Double>();
   
    int stations = 25;
    int classes = 6;
   
    SolverMultiClosedChow mClosedChow = new SolverMultiClosedChow(classes, stations, pop);
    if (mClosedChow.input(name, type, servt, visits)) {
      String algorithm = "Chow";
      mClosedChow.solve();
      models.put(algorithm, mClosedChow);
      long stop = System.currentTimeMillis();
      elapsedTimes.put(algorithm, ((stop - start)/(double)1000));
    } else {
      System.out.println("Wrong input!!");
View Full Code Here

TOP

Related Classes of jmt.analytical.SolverMultiClosedChow

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.