examples.jmdp

## Class CTInventory

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.InfiniteMDP<S,A>
    - - jmarkov.jmdp.CTMDP<examples.jmdp.CTStock,Order>
      - - examples.jmdp.CTInventory

-     public class CTInventory
      extends CTMDP<examples.jmdp.CTStock,Order>

  This class describes an inventory system with two items. Item 1 and item 2 have different demand rates. Ordering costs depend on trucks with fixed capacity that may transport any combination of the items. No leadtime.
  Author:
    Andres Sarmiento and Germán Riaño. Universidad de los Andes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CTInventory(States<examples.jmdp.CTStock> initSet, int maxCapacity, int truckSize, double K, double cost, double price, double holdingCost, double demandRateA, double leadTime)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `continuousCost(examples.jmdp.CTStock i, Order a)` Cost incurred continuously in time until the next transition from state i given that action a is taken.
    `Actions<Order>` | `feasibleActions(examples.jmdp.CTStock i)` Returns the set of actions available at this state.
    `void` | `initializeProbabilities()` Initialize the probabilities
    `double` | `lumpCost(examples.jmdp.CTStock i, Order a)` Cost incurred instantaneously in the moment when action a is taken from state i.
    `static void` | `main(java.lang.String[] args)` This method just tests the class.
    `double` | `rate(examples.jmdp.CTStock i, examples.jmdp.CTStock j, Order a)` Rate of going from state i to state j by taking the action a
    `States<examples.jmdp.CTStock>` | `reachable(examples.jmdp.CTStock 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.CTMDP

      `getAllStates, getMaxRate, getSteadyStateProbabilities, setConverter, solve`

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

      `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

    - #### CTInventory

          public CTInventory(States<examples.jmdp.CTStock> initSet,
                     int maxCapacity,
                     int truckSize,
                     double K,
                     double cost,
                     double price,
                     double holdingCost,
                     double demandRateA,
                     double leadTime)

      Parameters:
        `initSet` - Initial state
        `maxCapacity` - maximum physical capacity in inventory, warehouse size
        `truckSize` - maximum physical capacity of truck to carrying items
        `K` - Fixed cost per Order
        `cost` - Variable cost
        `price` - Sell price of item A
        `holdingCost` - Inventory holding cost per period
        `demandRateA` - Demand rate for item A
        `leadTime` - Time between the moment when the order is placed and the moment the order arrives

  - ### Method Detail

    - #### initializeProbabilities

          public void initializeProbabilities()

      Initialize the probabilities

    - #### feasibleActions

          public Actions<Order> feasibleActions(examples.jmdp.CTStock i)

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

    - #### reachable

          public States<examples.jmdp.CTStock> reachable(examples.jmdp.CTStock i,
                                                Order a)

      Description copied from class: `CTMDP`
      Set of States that can be reached from this state i, after taking the action a.
      Specified by:
        `reachable` in class `CTMDP<examples.jmdp.CTStock,Order>`
      Parameters:
        `i` - current State
        `a` - action taken
      Returns:
        the reachable states.

    - #### rate

          public double rate(examples.jmdp.CTStock i,
                    examples.jmdp.CTStock j,
                    Order a)

      Description copied from class: `CTMDP`
      Rate of going from state i to state j by taking the action a
      Specified by:
        `rate` in class `CTMDP<examples.jmdp.CTStock,Order>`
      Parameters:
        `i` - current state
        `j` - Destination state.
        `a` - Action taken
      Returns:
        The rate

    - #### lumpCost

          public double lumpCost(examples.jmdp.CTStock i,
                        Order a)

      Description copied from class: `CTMDP`
      Cost incurred instantaneously in the moment when action a is taken from state i.
      Specified by:
        `lumpCost` in class `CTMDP<examples.jmdp.CTStock,Order>`
      Parameters:
        `i` - State
        `a` - Action
      Returns:
        Lump cost received.

    - #### continuousCost

          public double continuousCost(examples.jmdp.CTStock i,
                              Order a)

      Description copied from class: `CTMDP`
      Cost incurred continuously in time until the next transition from state i given that action a is taken.
      Specified by:
        `continuousCost` in class `CTMDP<examples.jmdp.CTStock,Order>`
      Parameters:
        `i` - State
        `a` - Action
      Returns:
        Rate at which cost is incurred when action a is taken.

    - #### main

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

      This method just tests the class.
      Parameters:
        `args` - Not used
      Throws:
        `SolverException`