examples.jmdp

## Class Bank2Queues

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.InfiniteMDP<S,A>
    - - jmarkov.jmdp.CTMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>
      - - examples.jmdp.Bank2Queues

-     public class Bank2Queues
      extends CTMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>

  The present example describes a Bank office with "maxServers" tellers. There is a queue for clients for whom the bank wants to give the best service, and another queue for users who have no commercial relation with the bank and are not the service priority. At every transition, the bank can add or remove a teller serving one of the queues and remove him or add him to the other queue.
  Author:
    sarmiea

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Bank2Queues(States<examples.jmdp.BankQueues> initial, double clientMinuteCost, double userMinuteCost, double clientProbability, double lambda, double mu, int maxCapacity, int maxServers)` Builds a Bank2Queues

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `computeMOPs(examples.jmdp.BankQueues i, examples.jmdp.Bank2Queues.Measure m)` Computes the measure of performance m of queue i
    `double` | `continuousCost(examples.jmdp.BankQueues i, examples.jmdp.BankServers a)` Cost incurred continuously in time until the next transition from state i given that action a is taken.
    `Actions<examples.jmdp.BankServers>` | `feasibleActions(examples.jmdp.BankQueues i)` Returns the set of actions available at this state.
    `double` | `length()`
    `double` | `lumpCost(examples.jmdp.BankQueues i, examples.jmdp.BankServers a)` Cost incurred instantaneously in the moment when action a is taken from state i.
    `static void` | `main(java.lang.String[] args)` This method just tests the class.
    `double` | `rate(examples.jmdp.BankQueues i, examples.jmdp.BankQueues j, examples.jmdp.BankServers a)` Rate of going from state i to state j by taking the action a
    `States<examples.jmdp.BankQueues>` | `reachable(examples.jmdp.BankQueues i, examples.jmdp.BankServers a)` Set of States that can be reached from this state i, after taking the action a.

    - ### Methods inherited from class jmarkov.jmdp.CTMDP

      `getAllStates, getMaxRate, getSteadyStateProbabilities, setConverter, solve`

    - ### Methods inherited from class jmarkov.jmdp.InfiniteMDP

      `getNumStates, getSolver`

    - ### Methods inherited from class jmarkov.jmdp.MDP

      `debug, debug, debug, getDebugLevel, getOptimalPolicy, getOptimalValueFunction, getReporter, isFinite, isSolved, operation, printSolution, printSolution, setDebugLevel, setReporter, setSolver, solve`

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

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

- - ### Constructor Detail

    - #### Bank2Queues

          public Bank2Queues(States<examples.jmdp.BankQueues> initial,
                     double clientMinuteCost,
                     double userMinuteCost,
                     double clientProbability,
                     double lambda,
                     double mu,
                     int maxCapacity,
                     int maxServers)

      Builds a Bank2Queues
      Parameters:
        `initial` - Initial state in the system
        `clientMinuteCost` - The cost that is charged to clients with commercial relation with the bank per minute they stay in queue
        `userMinuteCost` - The cost that is charged to users with no commercial relation with the bank per minute they stay in queue
        `clientProbability` - Probability that the next client has a commercial relation with the bank
        `lambda` - Arrival rate to the bank
        `mu` - Service rate of tellers
        `maxCapacity` - Queues capacity
        `maxServers` - Maximum number of tellers available in the bank

  - ### Method Detail

    - #### computeMOPs

          public double computeMOPs(examples.jmdp.BankQueues i,
                           examples.jmdp.Bank2Queues.Measure m)

      Computes the measure of performance m of queue i
      Parameters:
        `i` - Specify which queue bank is wanted to measure
        `m` - Measure of performance required
      Returns:
        The m measure of performance of queue i

    - #### lumpCost

          public double lumpCost(examples.jmdp.BankQueues i,
                        examples.jmdp.BankServers a)

      Description copied from class: `CTMDP`
      Cost incurred instantaneously in the moment when action a is taken from state i.
      Specified by:
        `lumpCost` in class `CTMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>`
      Parameters:
        `i` - State
        `a` - Action
      Returns:
        Lump cost received.

    - #### continuousCost

          public double continuousCost(examples.jmdp.BankQueues i,
                              examples.jmdp.BankServers a)

      Description copied from class: `CTMDP`
      Cost incurred continuously in time until the next transition from state i given that action a is taken.
      Specified by:
        `continuousCost` in class `CTMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>`
      Parameters:
        `i` - State
        `a` - Action
      Returns:
        Rate at which cost is incurred when action a is taken.

    - #### reachable

          public States<examples.jmdp.BankQueues> reachable(examples.jmdp.BankQueues i,
                                                   examples.jmdp.BankServers a)

      Description copied from class: `CTMDP`
      Set of States that can be reached from this state i, after taking the action a.
      Specified by:
        `reachable` in class `CTMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>`
      Parameters:
        `i` - current State
        `a` - action taken
      Returns:
        the reachable states.

    - #### rate

          public double rate(examples.jmdp.BankQueues i,
                    examples.jmdp.BankQueues j,
                    examples.jmdp.BankServers a)

      Description copied from class: `CTMDP`
      Rate of going from state i to state j by taking the action a
      Specified by:
        `rate` in class `CTMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>`
      Parameters:
        `i` - current state
        `j` - Destination state.
        `a` - Action taken
      Returns:
        The rate

    - #### feasibleActions

          public Actions<examples.jmdp.BankServers> feasibleActions(examples.jmdp.BankQueues i)

      Description copied from class: `InfiniteMDP`
      Returns the set of actions available at this state.
      Specified by:
        `feasibleActions` in class `InfiniteMDP<examples.jmdp.BankQueues,examples.jmdp.BankServers>`
      Parameters:
        `i` - Current State
      Returns:
        set of Actions that can be taken at this state.

    - #### length

          public double length()
                        throws SolverException

      Returns:
        Average queue length
      Throws:
        `SolverException`

    - #### main

          public static void main(java.lang.String[] args)
                           throws SolverException

      This method just tests the class.
      Parameters:
        `args` - Not used
      Throws:
        `SolverException`