examples.jmdp

## Class OrderProcessing

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.InfiniteMDP<S,A>
    - - jmarkov.jmdp.DTMDP<examples.jmdp.PendingOrders,examples.jmdp.ProcessAction>
      - - examples.jmdp.OrderProcessing

-     public class OrderProcessing
      extends DTMDP<examples.jmdp.PendingOrders,examples.jmdp.ProcessAction>

  A company receives orders at a random rate. At each stage, the company can decide whether to process no orders incurring in a cost of unfilled order per order per stage, or to process all the pending orders incurring in a setup cost. This class belongs to the examples supplied in the package jmdp. The objective of this file is to show as clear as possible a simple way to use the jmdp package as a tool for solving problems. The complete details of the present problems are explained in the documentation. See Bersekas, "Dynamic Programming and Control".
  Author:
    Andres Sarmiento and Germán Riaño - Universidad de Los Andes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OrderProcessing(int initialPendingOrders, double setupCost, double unfilledOrderCost, int MaxOrders, double theta)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `averageOrders()`
    `double` | `computeMOPs(examples.jmdp.PendingOrders i, examples.jmdp.OrderProcessing.Measure m)`
    `Actions<examples.jmdp.ProcessAction>` | `feasibleActions(examples.jmdp.PendingOrders i)` Returns the set of actions available at this state.
    `double` | `immediateCost(examples.jmdp.PendingOrders i, examples.jmdp.ProcessAction a)` Cost incurred when taking action a from state i
    `static StatesSet<examples.jmdp.PendingOrders>` | `initialize(int initPendingOrders)`
    `static examples.jmdp.PendingOrders` | `initialState(int initPendingOrders)`
    `static void` | `main(java.lang.String[] args)`
    `double` | `prob(examples.jmdp.PendingOrders i, examples.jmdp.PendingOrders j, examples.jmdp.ProcessAction a)` Probability of going from state i to state j by taking the action a
    `States<examples.jmdp.PendingOrders>` | `reachable(examples.jmdp.PendingOrders i, examples.jmdp.ProcessAction a)` Set of states that can be reached from this state i, after taking the action a.

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

      `getSteadyStateProbabilities, setProbabilitySolver, solve`

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

      `getAllStates, 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

    - #### OrderProcessing

          public OrderProcessing(int initialPendingOrders,
                         double setupCost,
                         double unfilledOrderCost,
                         int MaxOrders,
                         double theta)

      Parameters:
        `initialPendingOrders` - Number of initial pending orders
        `setupCost` - Setup cost
        `unfilledOrderCost` - Cost of unfilled order per order per stage
        `MaxOrders` - Maximum orders pending
        `theta` - Demand rate

  - ### Method Detail

    - #### reachable

          public States<examples.jmdp.PendingOrders> reachable(examples.jmdp.PendingOrders i,
                                                      examples.jmdp.ProcessAction a)

      Description copied from class: `DTMDP`
      Set of states that can be reached from this state i, after taking the action a.
      Specified by:
        `reachable` in class `DTMDP<examples.jmdp.PendingOrders,examples.jmdp.ProcessAction>`
      Parameters:
        `i` - Current State
        `a` - Action taken
      Returns:
        The reachable states.

    - #### immediateCost

          public double immediateCost(examples.jmdp.PendingOrders i,
                             examples.jmdp.ProcessAction a)

      Description copied from class: `DTMDP`
      Cost incurred when taking action a from state i
      Specified by:
        `immediateCost` in class `DTMDP<examples.jmdp.PendingOrders,examples.jmdp.ProcessAction>`
      Parameters:
        `i` - Current State
        `a` - Current Action
      Returns:
        The cost incurred per transition

    - #### feasibleActions

          public Actions<examples.jmdp.ProcessAction> feasibleActions(examples.jmdp.PendingOrders i)

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

    - #### prob

          public double prob(examples.jmdp.PendingOrders i,
                    examples.jmdp.PendingOrders j,
                    examples.jmdp.ProcessAction a)

      Description copied from class: `DTMDP`
      Probability of going from state i to state j by taking the action a
      Specified by:
        `prob` in class `DTMDP<examples.jmdp.PendingOrders,examples.jmdp.ProcessAction>`
      Parameters:
        `i` - Current state.
        `j` - Destination State
        `a` - Action
      Returns:
        The probability.

    - #### computeMOPs

          public double computeMOPs(examples.jmdp.PendingOrders i,
                           examples.jmdp.OrderProcessing.Measure m)

      Parameters:
        `i` - Number of pending orders
        `m` - Required MOP
      Returns:
        Average order level

    - #### averageOrders

          public double averageOrders()
                               throws SolverException

      Returns:
        Average of pending orders
      Throws:
        `SolverException`

    - #### initialize

          public static StatesSet<examples.jmdp.PendingOrders> initialize(int initPendingOrders)

      Parameters:
        `initPendingOrders` -
      Returns:
        A States set representation of number of pending orders

    - #### initialState

          public static examples.jmdp.PendingOrders initialState(int initPendingOrders)

      Parameters:
        `initPendingOrders` -
      Returns:
        A state representation of this pnumber of pendinf orders.

    - #### main

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

      Parameters:
        `args` -
      Throws:
        `SolverException`