Coffee Shop Proof of Concept
Problem Summary
The following is a proof of concept for the math spec where we try to work through what a coffee shop model might look like.
Problem Summary: You run a coffee shop and want to optimize your schedule of baristas to make sure queue length is not too long but you also do not spend too much money. Every epoch a certain of customers come in and a certain amount can be served. Anyone not served is waiting in line.
Types, States, Parameters & Entities
Types
- USD = Float
- Time = Datetime
- consumers_served = Int
- number_baristas = Int
- consumer_id = Int
- delta_time = Delta Time
- number_consumers = Int
Derived Types
- Currency = USD
Compound Types
- barista_schedule: Dict[Time, number_baristas]
State
System (Global) State
Consumer State
Stateful Metrics
System Stateful Metrics
Coffee Shop Stateful Metrics
Parameters
Coffee Shop Parameter Set
Entities
Coffee Shop
Consumer
Actions, Policies, Mechanisms
Behavioral Actions:
- Distribution of serving time: the behavioral action that takes into account how many customers can be served given number_of_baristas
- Example 1: Sum of number_of_barista poisson distributions with mu = 1.
- : The distribution of customers that get added in an epoch:
- Could be random all the way through
- Could be time varying
- Could come from a
- le 1:
- Assume that store hours are 6AM - 8PM.
- Between 6AM-9AM -> Poisson(1/3)
- Between 9AM-4PM -> Poisson(1/2)
- Between 4PM-8PM -> Poisson(1)
System/Control Actions:
- Shift switching: An action that checks if we are at an hour where the number of baristas is different, and if so is passing a message for the policy of Modify Number of Baristas
- Accrue Wages: An action that each epoch checks the number of employees and sends a message to pay employees to accrue what amount needs to be paid
- Update Current Time: Meta step that simply passes to "Adjust Current Time" mechanism for updating what the current step
Policies
- Modify queue: given the inputs from the behavioral steps of serving + customer arrival, is calling mechanisms of "Update Queue Length" and "Track Customers Served"
- Pay employees: Policy which takes the parameter of employee_cost and figures out what wages are accrued, calls the mechanism "Add Wage Accrual"
- Modify number of baristas: Policy which possibly is calling the mechanism "Change Shift"
Mechanisms:
- Update Queue Length: Mechanism which changes the length of the current queue
- Track Customers Served: Mechanism that logs how many customers were served
- Add Wage Accrual: Mechanism that updates the state for the current wages_accrued
- Change Shift: Mechanism which changes shifts and modifies number_of_baristas
- Adjust Current Time: Mechanism which changes the state for time.
Metrics & KPIs
Metrics:
- Average length queue: AVG(queue_length) over simulation
- Total Employee Cost: SUM(wages_accrued) over simulation
- Total Customers Served: SUM(customers_served) over simulation
- Cost Per Customer: Total Employee Cost / Total Customers Served
KPIs:
- Minimal/Low Queue Length: Average length queue < C
- Minimal/Low Cost Per Customer: Cost Per Customer < C
Overall system success: 1 & 2 (both true)