jmarkov

## Class Utils

- java.lang.Object
- - junit.framework.Assert
  - - jmarkov.Utils

-     public class Utils
      extends junit.framework.Assert

  Author:
    German Riano. Universidad de los Andes. (C) 2006

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Utils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `assertArrayEquals(double[][] a1, double[][] a2)` Tests whether the two given array are equal.
    `static void` | `assertArrayEquals(double[][] a1, double[][] a2, double epsilon)`
    `static void` | `assertArrayEquals(double[] a1, double[] a2)` tests whether the two given array are equal.
    `static void` | `assertArrayEquals(double[] a1, double[] a2, double epsilon)` Tests whether these two array are equal.
    `static void` | `assertArrayEquals(java.lang.String msg, double[][] a1, double[][] a2, double epsilon)` tests whether the two given array have all values whitin epsilon.
    `static void` | `assertArrayEquals(java.lang.String msg, double[] a1, double[] a2, double epsilon)` tests whether the two given array have all values whitin epsilon.
    `static void` | `assertArrayEquals(java.lang.String msg, int[] a1, int[] a2)` tests whether the two given array have all values whitin epsilon.
    `static double[][]` | `flowProb(int M)` Creates a MxM flow line probability.
    `static double[]` | `getMVAthruput(int N, int M, double[] mu)`
    `static double[]` | `getMVAthruput(int N, int M, double[] mu, double[] alpha)`
    `static double[]` | `getMVAthruput(int N, int M, double[] mu, double[][] prob)` Gets the thruput rate for a system with the given parameters
    `static double[][]` | `getProb(int M)` Gets a probability matrix
    `static double[]` | `getSS(double[][] prob)` Gets a setady state probabilities for the fgieven matrix.
    `static void` | `resetMVA()` Resets MV parameters.

    - ### Methods inherited from class junit.framework.Assert

      `assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Utils

          public Utils()

  - ### Method Detail

    - #### assertArrayEquals

          public static void assertArrayEquals(double[] a1,
                               double[] a2)

      tests whether the two given array are equal.
      Parameters:
        `a1` - First array
        `a2` - Second array

    - #### assertArrayEquals

          public static void assertArrayEquals(double[] a1,
                               double[] a2,
                               double epsilon)

      Tests whether these two array are equal.
      Parameters:
        `a1` -
        `a2` -
        `epsilon` -

    - #### assertArrayEquals

          public static void assertArrayEquals(java.lang.String msg,
                               double[] a1,
                               double[] a2,
                               double epsilon)

      tests whether the two given array have all values whitin epsilon.
      Parameters:
        `msg` - Message to write when test fails.
        `a1` - First (expected) array.
        `a2` - Second (actual) array.
        `epsilon` - Tolerance.

    - #### assertArrayEquals

          public static void assertArrayEquals(java.lang.String msg,
                               int[] a1,
                               int[] a2)

      tests whether the two given array have all values whitin epsilon.
      Parameters:
        `msg` - Message to write when test fails.
        `a1` - First (expected) array.
        `a2` - Second (actual) array.

    - #### assertArrayEquals

          public static void assertArrayEquals(double[][] a1,
                               double[][] a2)

      Tests whether the two given array are equal.
      Parameters:
        `a1` - First array[][]
        `a2` - Second array[][]

    - #### assertArrayEquals

          public static void assertArrayEquals(double[][] a1,
                               double[][] a2,
                               double epsilon)

      Parameters:
        `a1` -
        `a2` -
        `epsilon` -

    - #### assertArrayEquals

          public static void assertArrayEquals(java.lang.String msg,
                               double[][] a1,
                               double[][] a2,
                               double epsilon)

      tests whether the two given array have all values whitin epsilon.
      Parameters:
        `msg` - The message to write when the test fails.
        `a1` - First array[][]
        `a2` - Second array[][]
        `epsilon` - Tolerance.

    - #### flowProb

          public static double[][] flowProb(int M)

      Creates a MxM flow line probability.
      Parameters:
        `M` - size
      Returns:
        A matrx where p(i,i+1) = 1.0

    - #### getMVAthruput

          public static double[] getMVAthruput(int N,
                               int M,
                               double[] mu)

      Parameters:
        `N` - Number of moving entities
        `M` - Number of stations
        `mu` - Process rates.
      Returns:
        troughput rates for the stations.

    - #### getMVAthruput

          public static double[] getMVAthruput(int N,
                               int M,
                               double[] mu,
                               double[] alpha)

      Parameters:
        `N` - Total wip
        `M` - Number of stations
        `mu` - Service rate
        `alpha` - relative importance
      Returns:
        Troughput rates for the stations.

    - #### getMVAthruput

          public static double[] getMVAthruput(int N,
                               int M,
                               double[] mu,
                               double[][] prob)

      Gets the thruput rate for a system with the given parameters
      Parameters:
        `N` - Total wip
        `M` - Number of stations
        `mu` - Service rate
        `prob` - Routing probabilities.
      Returns:
        The effective rates as computed using MVA.

    - #### resetMVA

          public static void resetMVA()

      Resets MV parameters.

    - #### getProb

          public static double[][] getProb(int M)

      Gets a probability matrix
      Parameters:
        `M` - Stations
      Returns:
        a routing matrix.

    - #### getSS

          public static double[] getSS(double[][] prob)

      Gets a setady state probabilities for the fgieven matrix.
      Parameters:
        `prob` - Markov probability matrix.
      Returns:
        SS prob vector.