examples.jmdp

## Class CTInventoryEvents

- java.lang.Object
- - jmarkov.jmdp.MDP<S,A>
  - - jmarkov.jmdp.InfiniteMDP<S,A>
    - - jmarkov.jmdp.CTMDP<S,A>
      - - jmarkov.jmdp.CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>
        - - examples.jmdp.CTInventoryEvents

-     public class CTInventoryEvents
      extends CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>

  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
    `CTInventoryEvents(States<examples.jmdp.CTStockE> 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
    --- | ---
    `Events<examples.jmdp.CTInventoryEvent>` | `activeEvents(examples.jmdp.CTStockE i, Order a)` Set of events that are active from state i given that action a is taken.
    `double` | `continuousCost(examples.jmdp.CTStockE i, Order a, examples.jmdp.CTInventoryEvent e)` Reward obtained continuously in time during the sojourn time in state i until an action a is taken and a transition is triggered.
    `Actions<Order>` | `feasibleActions(examples.jmdp.CTStockE i)` Returns the set of actions available at this state.
    `void` | `initializeProbabilities()` Initialize the probabilities
    `double` | `lumpCost(examples.jmdp.CTStockE i, Order a, examples.jmdp.CTInventoryEvent e)` Reward instantaneously gained 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.CTStockE i, examples.jmdp.CTStockE j, Order a, examples.jmdp.CTInventoryEvent e)` Rate.
    `States<examples.jmdp.CTStockE>` | `reachable(examples.jmdp.CTStockE i, Order a, examples.jmdp.CTInventoryEvent e)` Set of reachable states from state i given that action a is taken and event e occurs.

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

      `continuousCost, lumpCost, rate, reachable`

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

    - #### CTInventoryEvents

          public CTInventoryEvents(States<examples.jmdp.CTStockE> 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.CTStockE i)

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

    - #### activeEvents

          public Events<examples.jmdp.CTInventoryEvent> activeEvents(examples.jmdp.CTStockE i,
                                                            Order a)

      Description copied from class: `CTMDPEv`
      Set of events that are active from state i given that action a is taken.
      Specified by:
        `activeEvents` in class `CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>`
      Parameters:
        `i` - current state
        `a` - action taken
      Returns:
        set of events that can occur

    - #### reachable

          public States<examples.jmdp.CTStockE> reachable(examples.jmdp.CTStockE i,
                                                 Order a,
                                                 examples.jmdp.CTInventoryEvent e)

      Description copied from class: `CTMDPEv`
      Set of reachable states from state i given that action a is taken and event e occurs.
      Specified by:
        `reachable` in class `CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>`
      Parameters:
        `i` - current state
        `a` - action taken
        `e` - event that occurs
      Returns:
        set of reachable states.

    - #### rate

          public double rate(examples.jmdp.CTStockE i,
                    examples.jmdp.CTStockE j,
                    Order a,
                    examples.jmdp.CTInventoryEvent e)

      Description copied from class: `CTMDPEv`
      Rate. Rate of going of reaching state j given that the current state is i, the action taken is a and the event that occurs is e.
      Specified by:
        `rate` in class `CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>`
      Parameters:
        `i` - current state
        `j` - state to reach
        `a` - action taken (given)
        `e` - event that occurs (given)
      Returns:
        Rate

    - #### lumpCost

          public double lumpCost(examples.jmdp.CTStockE i,
                        Order a,
                        examples.jmdp.CTInventoryEvent e)

      Description copied from class: `CTMDPEv`
      Reward instantaneously gained in the moment when action a is taken from state i.
      Specified by:
        `lumpCost` in class `CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>`
      Parameters:
        `i` - current state
        `a` - action taken
        `e` - event that occurs
      Returns:
        instanteneous reward.

    - #### continuousCost

          public double continuousCost(examples.jmdp.CTStockE i,
                              Order a,
                              examples.jmdp.CTInventoryEvent e)

      Description copied from class: `CTMDPEv`
      Reward obtained continuously in time during the sojourn time in state i until an action a is taken and a transition is triggered.
      Specified by:
        `continuousCost` in class `CTMDPEv<examples.jmdp.CTStockE,Order,examples.jmdp.CTInventoryEvent>`
      Parameters:
        `i` - current state
        `a` - action taken
        `e` - event that occurs
      Returns:
        instanteneous reward.

    - #### main

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

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