Package jmt.analytical

Examples of jmt.analytical.SolverMultiClosedMVA


   
    double[][] mvaQueueLen = null;
    SolverMulti solver;
    String algorithm;
    if (classes < 5) {
      solver = new SolverMultiClosedMVA(classes, stations);
      algorithm = "MVA";
      if (((SolverMultiClosedMVA)solver).input(name, type, servt, visits, pop)) {
        long start = System.currentTimeMillis();
        solver.solve();
        System.out.print(algorithm+",");
        System.out.print(0+",");
        //System.out.println(algorithm);
        //System.out.println("-------------------------------------");
        mvaQueueLen = solver.getQueueLen();
        //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 SolverMultiClosedChow(classes, stations, pop);
    algorithm = "Chow";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.print(algorithm+",");
      //System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      //System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      //System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      //System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      //System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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!!");
    }

    if (classes > 4) {
      solver = new SolverMultiClosedMVA(classes, stations);
      algorithm = "MVA";
      if (((SolverMultiClosedMVA)solver).input(name, type, servt, visits, pop)) {
        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();
   
    double[][] mvaQueueLen = null;
   
    SolverMulti solver = new SolverMultiClosedMVA(classes, stations);
    String algorithm = "MVA";
    if (((SolverMultiClosedMVA)solver).input(name, type, servt, visits, pop)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.print(algorithm+",");
      System.out.print(0+",");
      //System.out.println(algorithm);
      //System.out.println("-------------------------------------");
      mvaQueueLen = solver.getQueueLen();
      //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 SolverMultiClosedChow(classes, stations, pop);
    algorithm = "Chow";
    if (solver.input(name, type, servt, visits)) {
      long start = System.currentTimeMillis();
      solver.solve();
      System.out.print(algorithm+",");
      System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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.print(algorithm+",");
      System.out.print(maxDiff(pop, solver.getQueueLen(), mvaQueueLen)+",");
      //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) + ",");
View Full Code Here

    Map<String, Double> elapsedTimes = new LinkedHashMap<String, Double>();
   
    int stations = 2;
    int classes = 3;
   
    SolverMultiClosedMVA mClosedMVA = new SolverMultiClosedMVA(classes, stations);
    if (mClosedMVA.input(name, type, servt, visits, pop)) {
      String algorithm = "MVA";
      mClosedMVA.solve();
      models.put(algorithm, mClosedMVA);
      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 = 2;
    int classes = 2;
   
    SolverMultiClosedMVA mClosedMVA = new SolverMultiClosedMVA(classes, stations);
    if (mClosedMVA.input(name, type, servt, visits, pop)) {
      String algorithm = "MVA";
      mClosedMVA.solve();
      models.put(algorithm, mClosedMVA);
      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 = 2;
    int classes = 4;
   
    SolverMultiClosedMVA mClosedMVA = new SolverMultiClosedMVA(classes, stations);
    if (mClosedMVA.input(name, type, servt, visits, pop)) {
      String algorithm = "MVA";
      mClosedMVA.solve();
      models.put(algorithm, mClosedMVA);
      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 = 2;
    int classes = 2;
   
    SolverMultiClosedMVA mClosedMVA = new SolverMultiClosedMVA(classes, stations);
    if (mClosedMVA.input(name, type, servt, visits, pop)) {
      String algorithm = "MVA";
      mClosedMVA.solve();
      models.put(algorithm, mClosedMVA);
      long stop = System.currentTimeMillis();
      elapsedTimes.put(algorithm, ((stop - start)/(double)1000));
    } else {
      System.out.println("Wrong input!!");
View Full Code Here

  public static void testMultiClosedLI() {

    System.out.println("Sistema chiuso con 2 classi");
    long start = System.currentTimeMillis();

    SolverMultiClosedMVA mClosed = new SolverMultiClosedMVA(3, 2);

    String[] name = { "Station1", "Station2" };
    int[] type = { Solver.LI, Solver.LI, };
    double[][][] servt = new double[2][3][1];

    int[] pop = new int[3];
    pop[0] = 10;
    pop[1] = 10;
    pop[2] = 10;

    //station 1
    servt[0][0][0] = 10;
    servt[0][1][0] = 5;
    servt[0][2][0] = 1;

    //station 2
    servt[1][0][0] = 5;
    servt[1][1][0] = 9;
    servt[1][2][0] = 1;

    double[][] visits = new double[2][3];

    //station 1
    visits[0][0] = 1;
    visits[0][1] = 1;
    visits[0][2] = 1;

    //station 2
    visits[1][0] = 1;
    visits[1][1] = 1;
    visits[1][2] = 1;

    if (mClosed.input(name, type, servt, visits, pop)) {
      mClosed.solve();
      System.out.println(mClosed);
      System.out.println("End Multi Closed LI");
      long stop = System.currentTimeMillis();
      System.out.print("Tempo trascorso: " + (stop - start));
      System.out.println();
View Full Code Here

  public static void testMultiClosedLI_visits_not1() {

    System.out.println("Sistema chiuso con 2 classi");
    long start = System.currentTimeMillis();

    SolverMultiClosedMVA mClosed = new SolverMultiClosedMVA(2, 2);

    String[] name = { "Station1", "Station2" };
    int[] type = { Solver.LI, Solver.LI, };
    double[][][] servt = new double[2][2][1];

    int[] pop = new int[2];
    pop[0] = 100;
    pop[1] = 50;

    //station 1
    servt[0][0][0] = 10;
    servt[0][1][0] = 5;

    //station 2
    servt[1][0][0] = 5;
    servt[1][1][0] = 9;

    double[][] visits = new double[2][2];

    //station 1
    visits[0][0] = 3;
    visits[0][1] = 4;

    //station 2
    visits[1][0] = 2;
    visits[1][1] = 5;

    if (mClosed.input(name, type, servt, visits, pop)) {
      mClosed.solve();
      System.out.println(mClosed);
      System.out.println("End Multi Closed LI");
      long stop = System.currentTimeMillis();
      System.out.print("Tempo trascorso: " + (stop - start));
      System.out.println();
View Full Code Here

  public static void testMultiClosedLI_big() {

    System.out.println("Sistema chiuso con 4 classi");
    long start = System.currentTimeMillis();

    SolverMultiClosedMVA mClosed = new SolverMultiClosedMVA(4, 2);

    String[] name = { "Station1", "Station2" };
    int[] type = { Solver.LI, Solver.LI, };
    double[][][] servt = new double[2][4][1];

    int[] pop = new int[4];
    pop[0] = 100;
    pop[1] = 100;
    pop[2] = 100;
    pop[3] = 100;

    //station 1
    servt[0][0][0] = 10;
    servt[0][1][0] = 5;
    servt[0][2][0] = 10;
    servt[0][3][0] = 5;

    //station 2
    servt[1][0][0] = 5;
    servt[1][1][0] = 9;
    servt[1][2][0] = 4;
    servt[1][3][0] = 5;

    double[][] visits = new double[2][4];

    //station 1
    visits[0][0] = 1;
    visits[0][1] = 1;
    visits[0][2] = 1;
    visits[0][3] = 1;

    //station 2
    visits[1][0] = 1;
    visits[1][1] = 1;
    visits[1][2] = 1;
    visits[1][3] = 1;

    if (mClosed.input(name, type, servt, visits, pop)) {
      mClosed.solve();
      System.out.println(mClosed);
      System.out.println("End Multi Closed LI");
      long stop = System.currentTimeMillis();
      System.out.print("Tempo trascorso: " + (stop - start));
      System.out.println();
View Full Code Here

   * @param L matrix of service times
   * @param N array of class populations
   */
  public static void solveClosedPFQN(int M, int R, double[][][] L, int[] N) {
    long tic = System.currentTimeMillis();
    SolverMultiClosedMVA mClosed = new SolverMultiClosedMVA(R, M);

    String[] name = new String[M];
    for (int i = 1; i <= M; i++) {
      name[i - 1] = "";
    }

    int[] type = new int[M];

    for (int i = 1; i <= M; i++) {
      type[i - 1] = Solver.LI;
    }

    int n = N.length;
    double[][] visits = new double[M][n];
    for (int i = 1; i <= M; i++) {
      for (int j = 1; j <= n; j++) {
        visits[i - 1][j - 1] = 1;
      }
    }

    if (mClosed.input(name, type, L, visits, N)) {
      mClosed.solve();
      System.out.println(mClosed);
      System.out.println("End Multi Closed LI");
      long toc = System.currentTimeMillis();
      System.out.print("Tempo trascorso: " + (toc - tic) + "ms");
      System.out.println();
View Full Code Here

TOP

Related Classes of jmt.analytical.SolverMultiClosedMVA

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.