examples.jmarkov

## Class AccessControl2Queues

- java.lang.Object
- - jmarkov.MarkovProcess<S,E>
  - - jmarkov.SimpleMarkovProcess<examples.jmarkov.AccessControl2QueuesState,examples.jmarkov.AccessControl2QueuesEvent>
    - - examples.jmarkov.AccessControl2Queues

- All Implemented Interfaces:
    JMarkovElement

      public class AccessControl2Queues
      extends SimpleMarkovProcess<examples.jmarkov.AccessControl2QueuesState,examples.jmarkov.AccessControl2QueuesEvent>

  This class represents a network with 2 queues in tandem, where the second queue has a buffer of size B and the first has a unit buffer.
  Author:
    Daniel F. Silva (2011)

- - ### Nested Class Summary

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

      `MarkovProcess.Status`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccessControl2Queues()` Default Constructor used by GUI
    `AccessControl2Queues(int B, double L, double Mu1, double Mu2, double c1, double c2, boolean pol, int[] length)` General constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `active(examples.jmarkov.AccessControl2QueuesState i, examples.jmarkov.AccessControl2QueuesEvent e)` Determine the active events.
    `java.lang.String` | `description()` This method should be implemented by the subclass to give word description of the model.
    `States<examples.jmarkov.AccessControl2QueuesState>` | `dests(examples.jmarkov.AccessControl2QueuesState i, examples.jmarkov.AccessControl2QueuesEvent e)` Determines the destination set of States when events e occurs.
    `int` | `getB()`
    `double` | `getCost()`
    `double` | `getLambda()`
    `double` | `getMu1()`
    `double` | `getMu2()`
    `double` | `getProb(int k, int l)`
    `static void` | `main(java.lang.String[] a)` Main method.
    `int` | `printMOPs(java.io.PrintWriter out, int width, int decimals)` Replaces the method to printo MOPs.
    `double` | `rate(examples.jmarkov.AccessControl2QueuesState i, examples.jmarkov.AccessControl2QueuesState j, examples.jmarkov.AccessControl2QueuesEvent e)` Returns the transition probability from State i to State j.

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

    - #### AccessControl2Queues

          public AccessControl2Queues(int B,
                              double L,
                              double Mu1,
                              double Mu2,
                              double c1,
                              double c2,
                              boolean pol,
                              int[] length)

      General constructor.
      Parameters:
        `B` - Buffer Size
        `Mu1` - First Server Rate.
        `Mu2` - Second Server Rate.
        `L` - Arrival Rate.
        `c1` - Cost of turning away.
        `c2` - Cost of lost customer.
        `pol` - Policy (true is greedy, false is prudent)

    - #### AccessControl2Queues

          public AccessControl2Queues()

      Default Constructor used by GUI

  - ### Method Detail

    - #### active

          public boolean active(examples.jmarkov.AccessControl2QueuesState i,
                       examples.jmarkov.AccessControl2QueuesEvent e)

      Determine the active events.
      Specified by:
        `active` in class `SimpleMarkovProcess<examples.jmarkov.AccessControl2QueuesState,examples.jmarkov.AccessControl2QueuesEvent>`
      Parameters:
        `i` - The current State
        `e` - The current Event.
      Returns:
        True if the Event is Active.

    - #### dests

          public States<examples.jmarkov.AccessControl2QueuesState> dests(examples.jmarkov.AccessControl2QueuesState i,
                                                                 examples.jmarkov.AccessControl2QueuesEvent 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.AccessControl2QueuesState,examples.jmarkov.AccessControl2QueuesEvent>`
      Parameters:
        `i` - current State.
        `e` - The Event that ocurred.
      Returns:
        The destination States

    - #### rate

          public double rate(examples.jmarkov.AccessControl2QueuesState i,
                    examples.jmarkov.AccessControl2QueuesState j,
                    examples.jmarkov.AccessControl2QueuesEvent e)

      Returns the transition probability from State i to State j.
      Specified by:
        `rate` in class `SimpleMarkovProcess<examples.jmarkov.AccessControl2QueuesState,examples.jmarkov.AccessControl2QueuesEvent>`
      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)`

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

    - #### printMOPs

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

      Replaces the method to printo MOPs. This method is called in `toString()`, which is also used in the MOP's tab in the GUI.
      Overrides:
        `printMOPs` in class `MarkovProcess<examples.jmarkov.AccessControl2QueuesState,examples.jmarkov.AccessControl2QueuesEvent>`
      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.

    - #### getB

          public int getB()

      Returns:
        Returns the size of the buffer at the second station.

    - #### getMu1

          public double getMu1()

      Returns:
        Returns rate of the server at the first station.

    - #### getMu2

          public double getMu2()

      Returns:
        Returns rate of the server at the second station.

    - #### getLambda

          public double getLambda()

      Returns:
        Returns the job arrival rate.

    - #### getCost

          public double getCost()

    - #### getProb

          public double getProb(int k,
                       int l)