A backorder records customer demand that available inventory cannot satisfy. In production planning, it captures the shortfall between demand and fulfilled units, and carries a penalty. section 2.5
Factory demand
If scooter or bike demand exceeds available inventory, the difference becomes a backorder. section 2.5
Listing 2.6 Transition Dynamic based on stochastic demand
def transition(state, action, demand, params: FactoryProblemDefinition):
day, inv_scooter, inv_bike, current_setup = state #A
demand_scooter, demand_bike = demand #A
produced_scooter = params.prod_capacity_scooter if action == 0 else 0 #B
produced_bike = params.prod_capacity_bike if action == 1 else 0 #B
inv_scooter += produced_scooter #B
inv_bike += produced_bike #B
satisfied_scooter = min(inv_scooter, demand_scooter) #C
satisfied_bike = min(inv_bike, demand_bike) #C
inv_scooter -= satisfied_scooter #D
inv_bike -= satisfied_bike #D
backorder_scooter = demand_scooter - satisfied_scooter #E
backorder_bike = demand_bike - satisfied_bike #E
next_setup = action if action in (0, 1) else current_setup #F
next_day = day + 1 #G
next_state = (next_day, inv_scooter, inv_bike, next_setup) #G
return next_state, produced_scooter, produced_bike, backorder_scooter, backorder_bike
The transition listing calculates each product’s backorder as demand minus units satisfied from inventory. section 2.5
