Main Run Function
Module to run the AMR Hub ABM simulation.
run_steps(simulation, plot_path, *, record, figures=None, trajectory=False)
Run the simulation loop until completion, optionally plotting live.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
simulation
|
Simulation
|
The simulation instance to run. |
required |
plot_path
|
Path | None
|
Directory to save plots if plotting is enabled, otherwise None. |
required |
record
|
bool
|
Whether to record agent states to a CSV file at the end of simulation. |
required |
figures
|
list | None
|
List of Matplotlib figure objects for live plotting, by default None |
None
|
trajectory
|
bool
|
Whether to plot agent trajectories at the end of simulation, by default False |
False
|
Source code in src/amr_hub_abm/run.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
simulate(*, plot=False, record=False, live=False, plot_trajectory=False, use_gpu=False, seed_infections=False)
Simulate the AMR Hub ABM based on a configuration file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plot
|
bool
|
Whether to save plots of the simulation at regular intervals, by default False |
False
|
record
|
bool
|
Whether to record agent states to a CSV file, by default False |
False
|
live
|
bool
|
Whether to display a live plot of the simulation, by default False |
False
|
plot_trajectory
|
bool
|
Whether to plot agent trajectories at the end of simulation, by default False |
False
|
seed_infections
|
bool
|
Whether to seed initial infections for demonstration purposes, by default False |
False
|
Source code in src/amr_hub_abm/run.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |