examples.jmarkov

## Class DriveThru

- java.lang.Object
- - jmarkov.MarkovProcess<S,E>
  - - jmarkov.SimpleMarkovProcess<examples.jmarkov.DriveThruState,examples.jmarkov.DriveThruEvent>
    - - examples.jmarkov.DriveThru

- All Implemented Interfaces:
    JMarkovElement

      public class DriveThru
      extends SimpleMarkovProcess<examples.jmarkov.DriveThruState,examples.jmarkov.DriveThruEvent>

  This class implements a Drive Thru. Extends SimpleMarkovProcess.
  Version:
    1.0a
  Author:
    Margarita Arana y Gloria Díaz. Universidad de los Andes. Mod: Germán Riaño (2004)

- - ### Nested Class Summary

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

      `MarkovProcess.Status`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DriveThru()` Default constructor for GUI.
    `DriveThru(double lambda, double mu1, double mu2, int M, int S, int N)` Constructor de un DriveThru.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `active(examples.jmarkov.DriveThruState s, examples.jmarkov.DriveThruEvent ev)` Determines when the states are active for each state.
    `java.lang.String` | `description()` This method should be implemented by the subclass to give word description of the model.
    `States<examples.jmarkov.DriveThruState>` | `dests(examples.jmarkov.DriveThruState i, examples.jmarkov.DriveThruEvent e)` Computes the status of the destination when an event occurs
    `static void` | `main(java.lang.String[] a)` Main method.
    `int` | `printMOPs(java.io.PrintWriter out, int width, int decimals)` Print all waiting times associated with each MOP
    `double` | `rate(examples.jmarkov.DriveThruState i, examples.jmarkov.DriveThruState j, examples.jmarkov.DriveThruEvent e)` Computes the rate: the rate is lambda if an arraival occurs, the rate is mu1 if a service type one is finished, the rate is mu2 if an service type two is finished.

    - ### 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, 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

    - #### DriveThru

          public DriveThru(double lambda,
                   double mu1,
                   double mu2,
                   int M,
                   int S,
                   int N)

      Constructor de un DriveThru.
      Parameters:
        `lambda` - Tasa de arribos
        `mu1` - Tasa de servicios del micrï¿½fono
        `mu2` - Tasa de servicios de la ventana
        `M` - Nï¿½mero mï¿½ximo de entidades en el sistema
        `S` - Nï¿½mero de servidores
        `N` - Nï¿½mero de puestos entre la ventana y el micrï¿½fono

    - #### DriveThru

          public DriveThru()

      Default constructor for GUI.

  - ### Method Detail

    - #### active

          public boolean active(examples.jmarkov.DriveThruState s,
                       examples.jmarkov.DriveThruEvent ev)

      Determines when the states are active for each state.
      Specified by:
        `active` in class `SimpleMarkovProcess<examples.jmarkov.DriveThruState,examples.jmarkov.DriveThruEvent>`
      Parameters:
        `s` - The current State
        `ev` - The current Event.
      Returns:
        True if the Event is Active.
      See Also:
        `SimpleMarkovProcess.active(State, Event)`

    - #### rate

          public double rate(examples.jmarkov.DriveThruState i,
                    examples.jmarkov.DriveThruState j,
                    examples.jmarkov.DriveThruEvent e)

      Computes the rate: the rate is lambda if an arraival occurs, the rate is mu1 if a service type one is finished, the rate is mu2 if an service type two is finished.
      Specified by:
        `rate` in class `SimpleMarkovProcess<examples.jmarkov.DriveThruState,examples.jmarkov.DriveThruEvent>`
      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.rate(State, State, Event)`

    - #### dests

          public States<examples.jmarkov.DriveThruState> dests(examples.jmarkov.DriveThruState i,
                                                      examples.jmarkov.DriveThruEvent e)

      Computes the status of the destination when an event occurs
      Specified by:
        `dests` in class `SimpleMarkovProcess<examples.jmarkov.DriveThruState,examples.jmarkov.DriveThruEvent>`
      Parameters:
        `i` - current State.
        `e` - The Event that ocurred.
      Returns:
        The destination States
      See Also:
        `SimpleMarkovProcess.dests(State, Event)`

    - #### 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.DriveThruState,examples.jmarkov.DriveThruEvent>`
      Returns:
        A description of the Model
      See Also:
        `JMarkovElement.label()`

    - #### printMOPs

          public int printMOPs(java.io.PrintWriter out,
                      int width,
                      int decimals)

      Print all waiting times associated with each MOP
      Overrides:
        `printMOPs` in class `MarkovProcess<examples.jmarkov.DriveThruState,examples.jmarkov.DriveThruEvent>`
      Parameters:
        `out` - The printer where the MOPS will be printed.
        `width` - the columns width
        `decimals` - the number of decimals to use.
      Returns:
        The max width among the declared MOPs. You can use this to align nicely your own MOPs.
      See Also:
        `MarkovProcess.printMOPs(PrintWriter)`, `MarkovProcess.printMOPs(PrintWriter, int, int)`

    - #### main

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

      Main method.
      Parameters:
        `a` - Not used.