examples.jmdp

## Class ControlProdNonEvents

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

-     public class ControlProdNonEvents
      extends DTMDP<InvLevel,Order>

  The problem is a periodic review, single item, 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 distribution with mean "lambda". 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 fixed 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
    `ControlProdNonEvents(int maxInventory, double fixedCost, double cost, double price, double holdingCost, double interestRate, double expDemand)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Actions<Order>` | `feasibleActions(InvLevel i)` Returns the set of actions available at this state.
    `int[]` | `getOptimalOrderSize()` Return the optimal order size for this inventory level.
    `int` | `getOptimalOrderSize(int invLevel)` Return the optimal order size for this inventory level.
    `double` | `getValueFunction(int invLevel)` Gets the optimal value function for this initial inventory level.
    `double` | `immediateCost(InvLevel i, Order a)` Cost incurred when taking action a from state i
    `static void` | `main(java.lang.String[] a)` Small 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

    - #### ControlProdNonEvents

          public ControlProdNonEvents(int maxInventory,
                              double fixedCost,
                              double cost,
                              double price,
                              double holdingCost,
                              double interestRate,
                              double expDemand)

      Parameters:
        `maxInventory` - maximum physical capacity in inventory, warehouse size. than this value, but will be charged more than one fixed cost.
        `fixedCost` - fixed cost per order
        `price` - unit price for all stages
        `cost` - unit costo for all stages
        `holdingCost` - holding cost per unit and per unit of time.
        `interestRate` - interest rate per period.
        `expDemand` - demand mean

  - ### Method Detail

    - #### getValueFunction

          public double getValueFunction(int invLevel)
                                  throws SolverException

      Gets the optimal value function for this initial inventory level.
      Parameters:
        `invLevel` - inventory level.
      Returns:
        The optimal value fo future costs.
      Throws:
        `SolverException`

    - #### getOptimalOrderSize

          public int getOptimalOrderSize(int invLevel)

      Return the optimal order size for this inventory level.
      Parameters:
        `invLevel` -
      Returns:
        order size.

    - #### getOptimalOrderSize

          public int[] getOptimalOrderSize()

      Return the optimal order size for this inventory level.
      Returns:
        order size.

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

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

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

    - #### printMatrices

          public void printMatrices()

      Very stupid method to see what this is doing!!

    - #### main

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

      Small test program
      Parameters:
        `a` -
      Throws:
        `SolverException`