examples.jmdp

## Class Inventory

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.FiniteMDP<InvLevel,Order>
    - - examples.jmdp.Inventory

-     public class Inventory
      extends FiniteMDP<InvLevel,Order>

  A periodic review inventory system that is exposed to random demand. There is no lead time and the warehouse capacity is limited. The parameters of the problem are: Warehouse capacity: int M Number of stages: int N Fixed cost per order: int K Demand probability function: double[] pr Demand cummulative probability function: double[] qr (q(i) = P{Demand >= i}) Selling cost: double[] F
  Author:
    Germán Riaño and Andres Sarmiento - Universidad de Los Andes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Inventory(int lastStage, States<InvLevel> initSet, int M, int K, double[] pr, double[] qr, double[] F)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Actions<Order>` | `feasibleActions(InvLevel i, int t)` Returns the actions available at this state i and at this stage t .
    `double` | `finalCost(InvLevel i)` This method returns the cost incurred if the last stage ends with the system at state i.
    `double` | `immediateCost(InvLevel i, Order a, int t)` This function must return the Immediate cost incurred when taking action a from state i
    `static void` | `main(java.lang.String[] a)`
    `double` | `prob(InvLevel i, InvLevel j, Order a, int t)` This is the probability of going from state i to state j by taking the action a at stage t.
    `States<InvLevel>` | `reachable(InvLevel i, Order a, int t)` Set of States that can be reached from this state i, at this stage t, after taking the acton a.

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

      `defaultFinalCost, getHorizon, getStates`

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

      `debug, debug, debug, getDebugLevel, getOptimalPolicy, getOptimalValueFunction, getReporter, getSolver, 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

    - #### Inventory

          public Inventory(int lastStage,
                   States<InvLevel> initSet,
                   int M,
                   int K,
                   double[] pr,
                   double[] qr,
                   double[] F)

      Parameters:
        `lastStage` - lastStage
        `initSet` -
        `M` - Capacity
        `K` - Fixed cost per Order
        `pr` - Demand probability function
        `qr` - q(i) = P{Demand >= i}
        `F` -

  - ### Method Detail

    - #### prob

          public double prob(InvLevel i,
                    InvLevel j,
                    Order a,
                    int t)

      Description copied from class: `FiniteMDP`
      This is the probability of going from state i to state j by taking the action a at stage t.
      Specified by:
        `prob` in class `FiniteMDP<InvLevel,Order>`
      Parameters:
        `i` - Current state
        `j` - Destination state
        `a` - Action taken
        `t` - Current time stage
      Returns:
        Probability

    - #### immediateCost

          public double immediateCost(InvLevel i,
                             Order a,
                             int t)

      Description copied from class: `FiniteMDP`
      This function must return the Immediate cost incurred when taking action a from state i
      Specified by:
        `immediateCost` in class `FiniteMDP<InvLevel,Order>`
      Parameters:
        `i` - Current state
        `a` - Action
        `t` - Current time stage
      Returns:
        Cost value

    - #### finalCost

          public double finalCost(InvLevel i)

      Description copied from class: `FiniteMDP`
      This method returns the cost incurred if the last stage ends with the system at state i. The user must extend this method.
      Specified by:
        `finalCost` in class `FiniteMDP<InvLevel,Order>`
      Parameters:
        `i` - Ending state
      Returns:
        Cost.

    - #### feasibleActions

          public Actions<Order> feasibleActions(InvLevel i,
                                       int t)

      Description copied from class: `FiniteMDP`
      Returns the actions available at this state i and at this stage t . The user must implement this method.
      Specified by:
        `feasibleActions` in class `FiniteMDP<InvLevel,Order>`
      Parameters:
        `i` - Current State
        `t` - Time stage
      Returns:
        Set of feasible actions.

    - #### reachable

          public States<InvLevel> reachable(InvLevel i,
                                   Order a,
                                   int t)

      Description copied from class: `FiniteMDP`
      Set of States that can be reached from this state i, at this stage t, after taking the acton a. The user must implement this method.
      Specified by:
        `reachable` in class `FiniteMDP<InvLevel,Order>`
      Parameters:
        `i` - Current state
        `a` - Action taken
        `t` - Time stage
      Returns:
        Set of reachable states.

    - #### main

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

      Parameters:
        `a` - Not used
      Throws:
        `java.lang.Exception`