examples.jmdp

## Class InfStochasticDemand

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.InfiniteMDP<S,A>
    - - jmarkov.jmdp.DTMDP<InvLevel,Order>
      - - examples.jmdp.InfStochasticDemand

-     public class InfStochasticDemand
      extends DTMDP<InvLevel,Order>

  This problem is a single item, periodic review, stochastic demand inventory problem. It is modeled like a discounted cost, infinite horizon, Markov Decision Problem. Demand is assumed to be random according to a Poisson Process distribution with given rate per period. The system is a periodic review problem in which an entity periodically checks the inventory level and takes decisions according to the states he finds. There is a price of selling each item and a cost for buying it. Besides, there is a holding cost incurred when holding one item in stock from one period to another. There is also a truckCost ordering cost independent of the size of the order placed. The objective is to minimize the expected discounted long run cost.
  Author:
    Germán Riaño and Andres Sarmiento - Universidad de Los Andes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InfStochasticDemand(int maxInv, int maxBO, int truckSize, double truckCost, double backorderCost, double price, double cost, double holdingCost, double intRate, double expDemand, boolean discounted)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Actions<Order>` | `feasibleActions(InvLevel i)` Returns the set of actions available at this state.
    `double` | `immediateCost(InvLevel i, Order a)` Cost incurred when taking action a from state i
    `static void` | `main(java.lang.String[] a)` Simple test Program.
    `void` | `printMatrices()` Very stupid method to see what this is doing!!
    `double` | `prob(InvLevel i, InvLevel j, Order a)` Probability of going from state i to state j by taking the action a
    `States<InvLevel>` | `reachable(InvLevel i, Order 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

    - #### InfStochasticDemand

          public InfStochasticDemand(int maxInv,
                             int maxBO,
                             int truckSize,
                             double truckCost,
                             double backorderCost,
                             double price,
                             double cost,
                             double holdingCost,
                             double intRate,
                             double expDemand,
                             boolean discounted)

      Parameters:
        `maxInv` - maximum physical capacity in inventory, warehouse size.
        `maxBO` - maximum backorders allowed
        `truckSize` - maximum items in each fixed cost order. Orders can be greater than this value, but will be charged more than one fixed cost.
        `truckCost` - fixed cost per order
        `backorderCost` - unit cost per backordered item per stage
        `price` - unit price
        `cost` - unit aquistion costo
        `holdingCost` - non-finantial holding cost (it does NOT include finantial cost)
        `intRate` - interest per period
        `expDemand` - demand mean
        `discounted` - Whether a discounted model (rather than average) is to be used.

  - ### Method Detail

    - #### reachable

          public States<InvLevel> reachable(InvLevel i,
                                   Order 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<InvLevel,Order>`
      Parameters:
        `i` - Current State
        `a` - Action taken
      Returns:
        The reachable states.

    - #### prob

          public double prob(InvLevel i,
                    InvLevel j,
                    Order 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<InvLevel,Order>`
      Parameters:
        `i` - Current state.
        `j` - Destination State
        `a` - Action
      Returns:
        The probability.

    - #### feasibleActions

          public Actions<Order> feasibleActions(InvLevel i)

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

    - #### immediateCost

          public double immediateCost(InvLevel i,
                             Order a)

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

    - #### printMatrices

          public void printMatrices()

      Very stupid method to see what this is doing!!

    - #### main

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

      Simple test Program.
      Parameters:
        `a` -
      Throws:
        `SolverException`