examples.jmdp

## Class MultiItems

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.InfiniteMDP<S,A>
    - - jmarkov.jmdp.DTMDP<examples.jmdp.MultiItemState,examples.jmdp.MultiItemOrder>
      - - examples.jmdp.MultiItems

-     public class MultiItems
      extends DTMDP<examples.jmdp.MultiItemState,examples.jmdp.MultiItemOrder>

  This file models a multi item inventory problem. The demands are random and independent in between them, with Poisson distribution with means "lambda[]".
  Author:
    Andres Sarmiento, Germán Riaño - Universidad de Los Andes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiItems(States<examples.jmdp.MultiItemState> initSet, int maxInventory, int maxItemsPerOrder, int typesOfItems, int[] maxBackorders, double K, double[] cost, double[] price, double h, double[] holdingCost, double[] theta, double[] backOrderCost)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Actions<examples.jmdp.MultiItemOrder>` | `feasibleActions(examples.jmdp.MultiItemState i)` Returns the set of actions available at this state.
    `double` | `immediateCost(examples.jmdp.MultiItemState i, examples.jmdp.MultiItemOrder a)` Cost incurred when taking action a from state i
    `static void` | `main(java.lang.String[] a)`
    `double` | `prob(examples.jmdp.MultiItemState i, examples.jmdp.MultiItemState j, examples.jmdp.MultiItemOrder a)` Probability of going from state i to state j by taking the action a
    `States<examples.jmdp.MultiItemState>` | `reachable(examples.jmdp.MultiItemState i, examples.jmdp.MultiItemOrder a)` This function initializes all the possible states.

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

    - #### MultiItems

          public MultiItems(States<examples.jmdp.MultiItemState> initSet,
                    int maxInventory,
                    int maxItemsPerOrder,
                    int typesOfItems,
                    int[] maxBackorders,
                    double K,
                    double[] cost,
                    double[] price,
                    double h,
                    double[] holdingCost,
                    double[] theta,
                    double[] backOrderCost)

      Parameters:
        `initSet` -
        `maxInventory` - Capacity
        `maxItemsPerOrder` - maximum mumber of items per order
        `typesOfItems` - starting in 0. indicates the maximum index of the types.
        `maxBackorders` - Capacity
        `K` - Fixed cost per Order
        `cost` - variable cost
        `price` - variable cost
        `h` - percentual cost of holding inventory
        `holdingCost` - holding cost per item per period.
        `theta` - means of the Poisson demands per stage
        `backOrderCost` - cost incurred when there is no

  - ### Method Detail

    - #### reachable

          public States<examples.jmdp.MultiItemState> reachable(examples.jmdp.MultiItemState i,
                                                       examples.jmdp.MultiItemOrder a)

      This function initializes all the possible states. Starts by creating all the possible states with total inventoty in 0 and iterates over the possible total inventories. For each, it iterates growing the number of backorders for the positions with no inventory.
      Specified by:
        `reachable` in class `DTMDP<examples.jmdp.MultiItemState,examples.jmdp.MultiItemOrder>`
      Parameters:
        `i` - Current State
        `a` - Action taken
      Returns:
        The reachable states.

    - #### prob

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

    - #### immediateCost

          public double immediateCost(examples.jmdp.MultiItemState i,
                             examples.jmdp.MultiItemOrder a)

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

    - #### feasibleActions

          public Actions<examples.jmdp.MultiItemOrder> feasibleActions(examples.jmdp.MultiItemState i)

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

    - #### main

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

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