nhra_gt.subgames.queuing¶
Patient Queuing Game and Wardrop Equilibrium Solver.
This module models the choice patients make between attending an Emergency Department (ED) or a General Practitioner (GP), based on expected wait times and out-of-pocket costs. It uses fixed-point iteration to find the equilibrium demand levels.
Classes¶
PatientUtilityParams
dataclass
¶
Parameters defining patient choice utility.
Attributes:
| Name | Type | Description |
|---|---|---|
gp_out_of_pocket |
float
|
Financial cost of GP visit ($). |
gp_wait_time_min |
float
|
Expected wait time for GP (minutes). |
patient_time_value_hour |
float
|
Shadow price of patient time ($/hr). |
ed_base_utility |
float
|
Intrinsic utility of ED (e.g. equipment access). |
logit_sensitivity |
float
|
Rationality parameter for logit choice. |
ed_outside_utility |
float
|
Utility of not seeking care. |
Source code in src/nhra_gt/subgames/queuing.py
Functions¶
beartype(fn)
¶
calculate_patient_utilities(ed_wait_min, p, p_global)
¶
Calculates utilities for choosing ED vs GP.
Returns:
| Type | Description |
|---|---|
tuple[Any, Any]
|
Tuple of (utility_ed, utility_gp). |
Source code in src/nhra_gt/subgames/queuing.py
solve_queuing_equilibrium_jax(total_base_demand, capacity, discharge_delay, params, p_global, max_iter=5)
¶
Finds the Wardrop Equilibrium for patient demand using fixed-point iteration. Returns (demand_ed, prob_ed).
Source code in src/nhra_gt/subgames/queuing.py
solve_queuing_equilibrium_legacy(total_base_demand, capacity, discharge_delay, params, p_global, max_iter=5)
¶
Legacy version of the queuing solver. Returns (demand_ed, prob_ed).