Package jmt.analytical

Examples of jmt.analytical.SolverSingleClosedMVA


  public static void testSingleClosedLI_1() {
    int n = 10;
    System.out.println("Sistema con: " + n + " customers");
    long start = System.currentTimeMillis();

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 4);
    String[] name = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type = { Solver.DELAY, Solver.LI, Solver.LI, Solver.LI, };
    double[][] servt = { { 15 }, { 0.03 }, { 0.005 }, { 0.027 } };
    double[] visit = { 1, 70, 121, 50 };

    if (mva.input(name, type, servt, visit)) {
      //mva.solve();
      mva.solve(true);
    }
    //System.out.println(mva);
    System.out.println(mva.toString());
    System.out.println("End LI");
    long stop = System.currentTimeMillis();
    System.out.print("Tempo trascorso: " + (stop - start));

  }
View Full Code Here


  public static void testSingleClosedLI_2() {
    int n = 100;
    System.out.println("Sistema con: " + n + " customers");
    long start = System.currentTimeMillis();

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 4);
    String[] name = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type = { Solver.DELAY, Solver.LI, Solver.LI, Solver.LI, };
    double[][] servt = { { 15 }, { 0.03 }, { 0.005 }, { 0.027 } };
    double[] visit = { 1, 70, 121, 50 };

    if (mva.input(name, type, servt, visit)) {
      mva.solve();
    }
    System.out.println(mva);
    System.out.println("End LI");
    System.out.print("Tempo trascorso: " + (System.currentTimeMillis() - start) / 1000);
View Full Code Here

  public static void testSingleClosedLI_3() {
    int n = 5000000;
    System.out.println("Sistema con: " + n + " customers");
    long start = System.currentTimeMillis();

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 4);
    String[] name = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type = { Solver.DELAY, Solver.LI, Solver.LI, Solver.LI, };
    //double[][] servt = {{15}, {0.03}, {0.005}, {0.027}};
    double[][] servt = { { 0.03 }, { 0.03 }, { 0.2 }, { 0.2 } };
    double[] visit = { 1, 1, 1, 1 };

    if (mva.input(name, type, servt, visit)) {
      mva.solve();
    }
    System.out.println(mva);
    System.out.println("End LI");
    System.out.print("Tempo trascorso: ");
    long elapsed = (System.currentTimeMillis() - start);
View Full Code Here

  public static void testSingleClosedLI_4() {
    int n = 3;
    System.out.println("Sistema con: " + n + " customers");
    long start = System.currentTimeMillis();

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 4);
    String[] name = { "Delay", "CPU", "Disk1", "Disk2" };
    int[] type = { Solver.DELAY, Solver.LI, Solver.LI, Solver.LI, };
    double[][] servt = { { 15 }, { 0.005 }, { 0.03 }, { 0.027 } };
    double[] visit = { 1, 121, 70, 50 };

    if (mva.input(name, type, servt, visit)) {
      //mva.solve();
      mva.solve(true);
      System.out.println(mva.toString());
      //mva.solve(false);
      //System.out.println(mva.toString());
    }

    System.out.println("End LI");
View Full Code Here

    for (int pop = 20000; pop < 100000; pop = pop + 10000) {
      int n = pop;
      System.out.println("Sistema con: " + n + " customers");
      long start = System.currentTimeMillis();

      SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 4);
      String[] name = { "Delay", "CPU", "Disk1", "Disk2" };
      int[] type = { Solver.DELAY, Solver.LI, Solver.LI, Solver.LI, };
      double[][] servt = { { 15 }, { 0.005 }, { 0.03 }, { 0.027 } };
      double[] visit = { 1, 121, 70, 50 };

      if (mva.input(name, type, servt, visit)) {
        //mva.solve();
        mva.solve(true);
      }
      System.out.println(mva);
      //System.out.println(mva.intermediateToString());
      System.out.println("End LI");
      long stop = System.currentTimeMillis();
View Full Code Here

  /**
   * Method used for testing LD models
   */
  public static void testSingleClosedLD() {

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(3, 4);
    String[] name = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type = { Solver.DELAY, Solver.LD, Solver.LI, Solver.LD };
    double[][] servt = { { 15 }, { 0, 0.03, 0.03, 0.03 }, { 0.005 }, { 0, 0.027, 0.027, 0.027 } };
    double[] visit = { 1, 70, 121, 50 };

    if (mva.input(name, type, servt, visit)) {
      long start = System.currentTimeMillis();
      mva.solve(false);
      long stop = System.currentTimeMillis();

      long elapsed = stop - start;
      System.out.println("Tempo trascorso...");
      System.out.println(Long.toString(elapsed));
View Full Code Here

  /**
   * Method used for testing LD models
   */
  public static void testSingleClosedLD2() {
    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(3, 4);
    String[] name = { "Disk1", "Delay", "CPU", "Disk2" };
    int[] type = { Solver.LD, Solver.DELAY, Solver.LI, Solver.LD };
    double[][] servt = { { 0, 0.03, 0.03, 0.03 }, { 15 }, { 0.005 }, { 0, 0.027, 0.027, 0.027 } };
    double[] visit = { 70, 1, 121, 50 };

    if (mva.input(name, type, servt, visit)) {
      mva.solve(false);
    }

    System.out.println(mva);
    System.out.println("End LD");

View Full Code Here

   */
  public static void testSingleClosedLD_step() {

    System.out.println("Customers: 1");

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(1, 4);
    String[] name = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type = { Solver.DELAY, Solver.LD, Solver.LI, Solver.LD };
    double[][] servt = { { 15 }, { 0, 0.03 }, { 0.005 }, { 0, 0.027 } };
    double[] visit = { 1, 70, 121, 50 };

    if (mva.input(name, type, servt, visit)) {
      mva.solve(false);
    }

    System.out.println(mva);

    System.out.println("Customers: 2");

    mva = new SolverSingleClosedMVA(2, 4);
    String[] name2 = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type2 = { Solver.DELAY, Solver.LD, Solver.LI, Solver.LD };
    double[][] servt2 = { { 15 }, { 0, 0.03, 0.03 }, { 0.005 }, { 0, 0.027, 0.027 } };
    double[] visit2 = { 1, 70, 121, 50 };

    if (mva.input(name2, type2, servt2, visit2)) {
      mva.solve(false);
    }

    System.out.println(mva);

    System.out.println("Customers: 3");

    mva = new SolverSingleClosedMVA(3, 4);
    String[] name3 = { "Delay", "Disk1", "CPU", "Disk2" };
    int[] type3 = { Solver.DELAY, Solver.LD, Solver.LI, Solver.LD };
    double[][] servt3 = { { 15 }, { 0, 0.03, 0.03, 0.03 }, { 0.005 }, { 0, 0.027, 0.027, 0.027 } };
    double[] visit3 = { 1, 70, 121, 50 };

    if (mva.input(name3, type3, servt3, visit3)) {
      mva.solve(false);
    }

    System.out.println(mva);
    System.out.println("End LD");

View Full Code Here

  public static void testSingleClosedLD_big() {
    int n = 50000; //customers

    long start = System.currentTimeMillis();

    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 2);
    String[] name = { "Delay", "Disk1" };
    int[] type = { Solver.DELAY, Solver.LD };

    double[] servLD = new double[n + 1];
    servLD[0] = 0;

    int i = 1;
    for (i = 1; i <= n; i++) {
      servLD[i] = 0.03;
    }

    double[][] servt = { { 15 }, servLD };
    double[] visit = { 1, 70 };

    long start2 = 0;
    if (mva.input(name, type, servt, visit)) {
      start2 = System.currentTimeMillis();
    }
    mva.solve(false);
    System.out.println(mva);

    long stop = System.currentTimeMillis();

    double elapsed = (double) (stop - start) / 1000;
View Full Code Here

  /**
   * Method used for testing
   */
  public static void testSingleClosedStability(int n) {
    SolverSingleClosedMVA mva = new SolverSingleClosedMVA(n, 3);
    String[] name = { "1", "2", "3" };
    int[] type = { Solver.LD, Solver.LD, Solver.LD };
    double[][] servt = new double[3][n + 1];
    double[] visit = { 1.0, 1.3, 2.5 };
    double p;

    for (int i = 1; i <= n; i++) {
      p = 1.0 / i;
      servt[0][i] = 0.020 * p;
      servt[1][i] = 0.024 * p;
      servt[2][i] = 0.007 * p;
    }

    if (mva.input(name, type, servt, visit)) {
      mva.solve();
    }
    System.out.println(mva);

    System.out.println("End Stability");
  }
View Full Code Here

TOP

Related Classes of jmt.analytical.SolverSingleClosedMVA

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.