liveBook · Manning

Stockout

As explained in Applied Reinforcement Learning

A stockout is a condition in which available inventory is insufficient to satisfy current demand.

A stockout occurs when demand exceeds available fuel. A gas station then loses immediate sales and risks damaging customer trust and future business. Ordering too little risks shortages; ordering too much adds inventory holding costs. Because deliveries take an uncertain number of days, today’s ordering decision affects whether fuel is available to meet later demand. section 6.6

Listing 6.4 Environment configuration and state representation
@dataclass
class GasStationConfig:
    """Configuration class for gas station inventory environment parameters."""
    max_inventory: int = 10         #A
    initial_inventory: int = 4      #B
    planning_horizon: int = 30      #C
    
    demand_mean: float = 2.0        #D
    demand_std_dev_factor: float = 0.5 #E
    demand_min: float = 0.0         #F
    demand_max: float = 10.0        #F
    
    delivery_delay_mean: int = 2    #G
    min_delivery_delay: int = 1     #H
    
    profit_per_tank: float = 100.0  #I
    stockout_penalty: float = 80.0  #J
    holding_cost_per_tank: float = 5.0 #K
    ordering_cost: float = 20.0     #L

The environment configuration assigns stockouts a penalty alongside fuel profits, holding costs, and ordering costs. section 6.6

How Applied Reinforcement Learning covers it

How deep it goes
Explains immediate sales losses and longer-term customer costs, without detailing a standalone stockout calculation.
Examples
Uses a gas station that may run out of fuel while awaiting uncertain deliveries.
What it assumes
Assumes familiarity with temporal-difference learning, Q-learning, SARSA, and eligibility traces.
What you can do after
Understand how stockout costs weigh against holding costs when making sequential fuel-ordering decisions.
How it connects
Connects stockouts to customer demand, inventory management, holding costs, and delivery lead times.

Also explained in

Compare how 2 books explain stockout →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Applied Reinforcement Learning. The section links point to the parts of the book it draws on.