examples.jmarkov

## Class BBPhase

- java.lang.Object
- - jmarkov.MarkovProcess<S,E>
  - - jmarkov.SimpleMarkovProcess<examples.jmarkov.BBPhaseState,examples.jmarkov.BBPhaseEvent>
    - - examples.jmarkov.BBPhase

- All Implemented Interfaces:
    JMarkovElement

      public class BBPhase
      extends SimpleMarkovProcess<examples.jmarkov.BBPhaseState,examples.jmarkov.BBPhaseEvent>

  This is the Java implementation for the Bucket Brigades System using Phase Distribution. This code is based on the Bucket Brigades - Java Modelling created by Diego Rojas
  Version:
    4
  Author:
    Juan Pablo Alvarado, Germán Riaño, PhD

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class jmarkov.MarkovProcess

      `MarkovProcess.Status`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BBPhase(int N, int M, ContPhaseVar[] machineTimes, double[][] vels)` Builds a Bucket Brigade system.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `active(examples.jmarkov.BBPhaseState i, examples.jmarkov.BBPhaseEvent e)` Determines if event e is active when the system is in state i.
    `java.lang.String` | `description()` This method should be implemented by the subclass to give word description of the model.
    `States<examples.jmarkov.BBPhaseState>` | `dests(examples.jmarkov.BBPhaseState i, examples.jmarkov.BBPhaseEvent e)` Determines the destination set of States when events e occurs.
    `java.util.ArrayList<java.lang.Integer>` | `getNewMachPhases(int actOpe, int newMach, ContPhaseVar[][] phases)` This Method returns the new phase when a worker starts a work in a new machine
    `java.util.ArrayList<java.lang.Integer>` | `getNewPhases(int actOpe, int curMach, int curPhase, ContPhaseVar[][] phases)` This Method finds the new phase for a given worker
    `int[]` | `getResetMacs(int[] curMacs)` This method creates a vector with the new machines after a reset
    `int[]` | `getResetPhases(int[] curPhs, int[] curMacs)` This method creates a vector with the new phases after a reset
    `double` | `getResetRate()` Returns the steadystate rate of occurrance of a Reset resetRate;
    `static void` | `main(java.lang.String[] a)` Runs a stupid trial
    `double` | `rate(examples.jmarkov.BBPhaseState i, examples.jmarkov.BBPhaseState j, examples.jmarkov.BBPhaseEvent e)` These are the SimpleMarkovProcess methods.

    - ### Methods inherited from class jmarkov.SimpleMarkovProcess

      `activeTransitions`

    - ### Methods inherited from class jmarkov.MarkovProcess

      `addMOP, allToString, canGo, clearMOPs, debug, debug, debug, denseMatrixToString, denseMatrixToString, eventRatesToString, eventsRatesToString, generate, getDebugLevel, getDebugReporter, getEventClass, getEventNames, getEventRate, getEvents, getEventsRates, getFinalRate, getGenerator, getMaxStates, getMOPIndex, getMOPNames, getMOPNames, getMOPsAvg, getMOPsAvg, getMOPsAvg, getMOPsMoment, getMOPsMoment, getMOPsMoment, getMtjGenerator, getMtjRates, getNumStates, getProgress, getRate, getRates, getRates, getStateClass, getStates, getStates, getStatus, getStatusMsg, getSteadyState, getSteadyStateSolver, getTransientSolver, go, goStep, hideGUI, isGenerated, killGUI, label, loadGUI, MOPsToString, MOPsToString, numMOPs, pause, printAll, printAll, printDenseMatrix, printDenseMatrix, printEventsRates, printEventsRates, printMOPs, printMOPs, printMOPs, printStates, printStates, reset, resetResults, setDebugLevel, setDebugReporter, setMaxStates, setMOPs, setSteadyStateSolver, setTransientSolver, showGUI, statesLableMaxWidth, statesToString, toString`

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

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

    - ### Methods inherited from interface jmarkov.basic.JMarkovElement

      `equals`

- - ### Constructor Detail

    - #### BBPhase

          public BBPhase(int N,
                 int M,
                 ContPhaseVar[] machineTimes,
                 double[][] vels)

      Builds a Bucket Brigade system.
      Parameters:
        `N` - Number of worker
        `M` - Number of machines
        `machineTimes` - PH distributions
        `vels` - Vels[i][i] is the relative velocities for workeri at machine j

  - ### Method Detail

    - #### active

          public boolean active(examples.jmarkov.BBPhaseState i,
                       examples.jmarkov.BBPhaseEvent e)

      Description copied from class: `SimpleMarkovProcess`
      Determines if event e is active when the system is in state i. It has to be implemented by a subclass.
      Specified by:
        `active` in class `SimpleMarkovProcess<examples.jmarkov.BBPhaseState,examples.jmarkov.BBPhaseEvent>`
      Parameters:
        `i` - The current State
        `e` - The current Event.
      Returns:
        True if the Event is Active.

    - #### rate

          public double rate(examples.jmarkov.BBPhaseState i,
                    examples.jmarkov.BBPhaseState j,
                    examples.jmarkov.BBPhaseEvent e)

      These are the SimpleMarkovProcess methods.
      Specified by:
        `rate` in class `SimpleMarkovProcess<examples.jmarkov.BBPhaseState,examples.jmarkov.BBPhaseEvent>`
      Parameters:
        `i` - Current state
        `j` - Destination State
        `e` - The occuring event
      Returns:
        The rate at which the system goes from i to j when e occurs.
      See Also:
        `SimpleMarkovProcess.dests(State, Event)`

    - #### dests

          public States<examples.jmarkov.BBPhaseState> dests(examples.jmarkov.BBPhaseState i,
                                                    examples.jmarkov.BBPhaseEvent e)

      Description copied from class: `SimpleMarkovProcess`
      Determines the destination set of States when events e occurs. It has to be implemented by the subclass.
      Specified by:
        `dests` in class `SimpleMarkovProcess<examples.jmarkov.BBPhaseState,examples.jmarkov.BBPhaseEvent>`
      Parameters:
        `i` - current State.
        `e` - The Event that ocurred.
      Returns:
        The destination States

    - #### getNewPhases

          public java.util.ArrayList<java.lang.Integer> getNewPhases(int actOpe,
                                                            int curMach,
                                                            int curPhase,
                                                            ContPhaseVar[][] phases)

      This Method finds the new phase for a given worker
      Parameters:
        `actOpe` -
        `curMach` -
        `curPhase` -
        `phases` -
      Returns:
        newPhase

    - #### getNewMachPhases

          public java.util.ArrayList<java.lang.Integer> getNewMachPhases(int actOpe,
                                                                int newMach,
                                                                ContPhaseVar[][] phases)

      This Method returns the new phase when a worker starts a work in a new machine
      Parameters:
        `actOpe` -
        `newMach` -
        `phases` -
      Returns:
        A list of Phases

    - #### getResetPhases

          public int[] getResetPhases(int[] curPhs,
                             int[] curMacs)

      This method creates a vector with the new phases after a reset
      Parameters:
        `curPhs` -
        `curMacs` -
      Returns:
        newPhases[]

    - #### getResetMacs

          public int[] getResetMacs(int[] curMacs)

      This method creates a vector with the new machines after a reset
      Parameters:
        `curMacs` -
      Returns:
        newMacs [];

    - #### getResetRate

          public double getResetRate()
                              throws NotUnichainException

      Returns the steadystate rate of occurrance of a Reset resetRate;
      Returns:
        The long-run reste rate i.e., the throughput of the system.
      Throws:
        `NotUnichainException`

    - #### description

          public java.lang.String description()

      Description copied from class: `MarkovProcess`
      This method should be implemented by the subclass to give word description of the model. For example it should say: Queueing system with 2 servers and exponential arrivals with rate 50 per hour.
      Specified by:
        `description` in interface `JMarkovElement`
      Specified by:
        `description` in class `MarkovProcess<examples.jmarkov.BBPhaseState,examples.jmarkov.BBPhaseEvent>`
      Returns:
        A description of the Model
      See Also:
        `JMarkovElement.label()`

    - #### main

          public static void main(java.lang.String[] a)

      Runs a stupid trial
      Parameters:
        `a` -