API reference
amr_hub_abm package.
agent
Module to represent an agent in the AMR Hub ABM simulation.
Agent
dataclass
Representation of an agent in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/agent.py
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 109 110 111 112 113 114 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
heading_degrees
property
writable
Get the agent's heading in degrees.
__post_init__()
Post-initialization to log agent creation.
Source code in src/amr_hub_abm/agent.py
82 83 84 85 86 87 88 89 90 91 92 93 | |
__repr__()
Return a string representation of the agent.
Source code in src/amr_hub_abm/agent.py
156 157 158 159 160 161 162 163 | |
add_task(time, location, event_type, additional_info=None)
Add a task to the agent's task list and log the addition.
Source code in src/amr_hub_abm/agent.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
check_if_location_reached(target_location)
Check if the agent has reached the target location.
Source code in src/amr_hub_abm/agent.py
120 121 122 123 124 125 126 127 128 | |
check_intersection_with_walls(walls)
Check if the agent intersects with any walls.
Source code in src/amr_hub_abm/agent.py
108 109 110 111 112 113 114 115 116 117 118 | |
estimate_time_to_reach_location(target_location)
Estimate the time required to reach a target location.
Source code in src/amr_hub_abm/agent.py
384 385 386 387 | |
get_room()
Get the room the agent is currently located in, if any.
Source code in src/amr_hub_abm/agent.py
95 96 97 98 99 100 101 102 103 104 105 106 | |
head_to_point(point)
Set the agent's heading to face a specific point.
Source code in src/amr_hub_abm/agent.py
230 231 232 233 234 235 | |
move_one_step()
Move the agent one step in the direction of its heading.
Source code in src/amr_hub_abm/agent.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
move_to_location(new_location)
Move the agent to a new location and log the movement.
Source code in src/amr_hub_abm/agent.py
130 131 132 133 134 | |
perform_in_progress_task(current_time)
Perform an in-progress task and return True if a task was performed.
Source code in src/amr_hub_abm/agent.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
perform_moving_to_task_location(current_time)
Move the agent towards the location of its next task.
Source code in src/amr_hub_abm/agent.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | |
perform_suspended_task(current_time)
Perform a suspended task and return True if a task was performed.
Source code in src/amr_hub_abm/agent.py
291 292 293 294 295 296 297 298 299 300 301 302 303 | |
perform_task(current_time, rooms)
Perform the agent's current task if it's due.
Source code in src/amr_hub_abm/agent.py
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | |
perform_to_be_started_task(current_time)
Perform a to-be-started task and return True if a task was performed.
Source code in src/amr_hub_abm/agent.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | |
plot_agent(ax, *, show_tags=False)
Plot the agent on the given axes.
Source code in src/amr_hub_abm/agent.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
AgentType
Bases: Enum
Enumeration of possible agent types.
Source code in src/amr_hub_abm/agent.py
32 33 34 35 36 37 | |
InfectionStatus
Bases: Enum
Enumeration of possible infection statuses.
Source code in src/amr_hub_abm/agent.py
47 48 49 50 51 52 53 | |
exceptions
Module defining all custom exceptions for the AMR Hub ABM simulation.
InvalidDefinitionError
Bases: Exception
Exception raised when a general invalid definition is encountered.
Source code in src/amr_hub_abm/exceptions.py
53 54 55 56 57 58 | |
__init__(message)
Initialize the InvalidDefinitionError.
Source code in src/amr_hub_abm/exceptions.py
56 57 58 | |
InvalidDistanceError
Bases: Exception
Exception raised when an invalid distance calculation is attempted.
Source code in src/amr_hub_abm/exceptions.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
__init__(locations, building)
Initialize the InvalidDistanceError.
Source code in src/amr_hub_abm/exceptions.py
15 16 17 18 19 20 21 22 23 24 25 26 | |
InvalidDoorError
Bases: Exception
Exception raised when a door is defined with invalid parameters.
Source code in src/amr_hub_abm/exceptions.py
45 46 47 48 49 50 | |
__init__(message)
Initialize the InvalidDoorError.
Source code in src/amr_hub_abm/exceptions.py
48 49 50 | |
InvalidRoomError
Bases: Exception
Exception raised when a room is defined with invalid parameters.
Source code in src/amr_hub_abm/exceptions.py
37 38 39 40 41 42 | |
__init__(message)
Initialize the InvalidRoomError.
Source code in src/amr_hub_abm/exceptions.py
40 41 42 | |
SimulationModeError
Bases: Exception
Exception raised when an operation is invalid for the current simulation mode.
Source code in src/amr_hub_abm/exceptions.py
4 5 6 7 8 9 | |
__init__(message)
Initialize the SimulationModeError.
Source code in src/amr_hub_abm/exceptions.py
7 8 9 | |
TimeError
Bases: Exception
Exception raised when a negative time value is encountered.
Source code in src/amr_hub_abm/exceptions.py
29 30 31 32 33 34 | |
__init__(message)
Initialize the TimeError.
Source code in src/amr_hub_abm/exceptions.py
32 33 34 | |
read_space_input
Module to import space input data for the AMR Hub ABM simulation.
SpaceInputReader
dataclass
Class to read space input data from a YAML file.
Source code in src/amr_hub_abm/read_space_input.py
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 109 110 111 112 113 114 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
__post_init__()
Post-initialization to read and validate the YAML file.
Source code in src/amr_hub_abm/read_space_input.py
43 44 45 46 47 48 49 50 51 52 53 54 | |
check_tuple_length(data_tuple, expected_length, data_type)
staticmethod
Check if a data tuple has the expected length.
Source code in src/amr_hub_abm/read_space_input.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
create_doors_from_detatched_doors()
Create Door instances from detatched doors.
Source code in src/amr_hub_abm/read_space_input.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
create_room(room_data, room_id, building_name, floor_level)
Create a Room instance from room data.
Source code in src/amr_hub_abm/read_space_input.py
197 198 199 200 201 202 203 204 205 | |
create_rooms_from_data()
Create Room instances from the validated data.
Source code in src/amr_hub_abm/read_space_input.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
create_spatial_room(room_data, room_id, building_name, floor_level)
Create a spatial Room instance from room data.
Source code in src/amr_hub_abm/read_space_input.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
create_topological_room(room_data, room_id, building_name, floor_level)
Create a topological Room instance from room data.
Source code in src/amr_hub_abm/read_space_input.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
get_room_name_dict()
Extract room names and their corresponding detatched doors.
Source code in src/amr_hub_abm/read_space_input.py
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 | |
organise_rooms_into_floors_and_buildings(rooms)
staticmethod
Organize rooms into floors and buildings.
Source code in src/amr_hub_abm/read_space_input.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
validate_building_data(building_data)
staticmethod
Validate the building data structure.
Source code in src/amr_hub_abm/read_space_input.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
validate_floor_data(floor_data)
staticmethod
Validate the floor data structure.
Source code in src/amr_hub_abm/read_space_input.py
271 272 273 274 275 276 277 278 279 280 281 282 | |
validate_room_data(room_data)
staticmethod
Validate the room data structure.
Source code in src/amr_hub_abm/read_space_input.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
validation()
Validate the space input data from the YAML file.
Source code in src/amr_hub_abm/read_space_input.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
simulation
The main simulation module for the AMR Hub ABM.
Simulation
dataclass
Representation of the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/simulation.py
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 | |
rooms
property
Get all rooms in the simulation space.
__repr__()
Representation of the simulation.
Source code in src/amr_hub_abm/simulation.py
82 83 84 85 86 87 88 89 90 91 92 93 94 | |
plot_current_state(directory_path)
Plot the current state of the simulation.
Source code in src/amr_hub_abm/simulation.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
step(plot_path=None)
Advance the simulation by one time step.
Source code in src/amr_hub_abm/simulation.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
SimulationMode
Bases: Enum
Enumeration of simulation modes.
Source code in src/amr_hub_abm/simulation.py
24 25 26 27 28 | |
simulation_factory
Module for creating simulation instances.
create_simulation(config_file)
Create a simulation instance from a configuration file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_file
|
Path
|
Path to the configuration file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Simulation |
Simulation
|
An instance of the Simulation class. |
Source code in src/amr_hub_abm/simulation_factory.py
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 | |
create_space_from_rooms(rooms)
Create a list of Building instances from a list of Room instances.
Source code in src/amr_hub_abm/simulation_factory.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
get_random_location(room, building, floor)
Get a random location within a room.
Source code in src/amr_hub_abm/simulation_factory.py
118 119 120 121 122 123 124 125 126 | |
parse_location_string(location_str)
Parse a location string into its components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location_str
|
str
|
The location string in the format "BuildingName:x,y". |
required |
Returns:
| Type | Description |
|---|---|
str
|
tuple[str, int, str]: A tuple containing the building name, floor number, |
int
|
and room name. |
Source code in src/amr_hub_abm/simulation_factory.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
parse_location_timeseries(timeseries_data, rooms, start_time, time_step_minutes)
Parse a CSV file containing location time series data for agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeseries_data
|
DataFrame
|
DataFrame containing the location time series. |
required |
Returns:
| Type | Description |
|---|---|
list[Agent]
|
list[Agent]: A list of Agent instances with populated location time series. |
Source code in src/amr_hub_abm/simulation_factory.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
read_location_timeseries(file_path)
Read a CSV file containing location time series data for agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path
|
Path to the CSV file. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: DataFrame containing the location time series data. |
Source code in src/amr_hub_abm/simulation_factory.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
timestamp_to_timestep(timestamp, start_time, time_step_minutes)
Convert a timestamp to a simulation time step index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestamp
|
Timestamp
|
The timestamp to convert. |
required |
start_time
|
Timestamp
|
The simulation start time. |
required |
time_step_minutes
|
int
|
The duration of each time step in minutes. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The corresponding time step index. |
Source code in src/amr_hub_abm/simulation_factory.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
update_hcw(hcw_id, space_tuple, event_tuple, hcw_dict, space, additional_info=None)
Update healthcare worker information from data.
Source code in src/amr_hub_abm/simulation_factory.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
update_patient(patient_id, space_tuple, patient_dict, space)
Update patient information from data.
Source code in src/amr_hub_abm/simulation_factory.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
space
Space module for the AMR Hub ABM simulation.
building
Module containing building representation for the AMR Hub ABM simulation.
Building
dataclass
Representation of a building in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/space/building.py
15 16 17 18 19 20 21 22 23 24 25 26 27 | |
plot_building(axes, agents=None)
Plot the building layout.
Source code in src/amr_hub_abm/space/building.py
22 23 24 25 26 27 | |
content
Module defining room content types for the rooms of the AMR Hub ABM simulation.
Content
dataclass
Enumeration of possible room contents.
Source code in src/amr_hub_abm/space/content.py
14 15 16 17 18 19 | |
ContentType
Bases: Enum
Enumeration of possible room content types.
Source code in src/amr_hub_abm/space/content.py
7 8 9 10 11 | |
door
Module defining door representation for the AMR Hub ABM simulation.
DetachedDoor
dataclass
Representation of a detached door in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/space/door.py
10 11 12 13 14 15 16 17 18 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 | |
__eq__(other)
Define equality comparison for DetachedDoor instances.
Source code in src/amr_hub_abm/space/door.py
31 32 33 34 35 | |
__hash__()
Define hash for DetachedDoor instances.
Source code in src/amr_hub_abm/space/door.py
37 38 39 | |
__post_init__()
Post-initialization to validate door coordinates.
Source code in src/amr_hub_abm/space/door.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
check_for_start_end_consistency()
Check that start and end points are consistent.
Source code in src/amr_hub_abm/space/door.py
41 42 43 44 45 46 47 48 49 | |
Door
dataclass
Bases: DetachedDoor
Representation of a door in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/space/door.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
line
property
Get the line representation of the door.
__lt__(other)
Define less-than comparison for Door instances.
Source code in src/amr_hub_abm/space/door.py
83 84 85 86 87 | |
__post_init__()
Post-initialization to validate door coordinates and create hash.
Source code in src/amr_hub_abm/space/door.py
89 90 91 | |
floor
Module for Floor class.
Floor
dataclass
Representation of a floor in a building.
Source code in src/amr_hub_abm/space/floor.py
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 109 110 111 112 113 114 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 145 146 147 | |
adjacency_matrix
property
Get the adjacency matrix representing room connections on the floor.
edge_set
property
Get a list of all wall edges on the floor.
room_ids
property
Get a list of room IDs on the floor.
room_names
property
Get a list of room names on the floor.
__post_init__()
Post-initialization to validate floor attributes.
Source code in src/amr_hub_abm/space/floor.py
28 29 30 31 32 33 | |
add_pseudo_rooms()
Add pseudo-rooms to the floor.
Source code in src/amr_hub_abm/space/floor.py
78 79 80 81 82 83 | |
create_spatial_room_from_pseudo_room(room)
staticmethod
Create a spatial room from a pseudo-room based on area.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
room
|
Room
|
The pseudo-room to convert. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Room |
Room
|
A spatial room with walls and doors based on the pseudo-room's area. |
Raises:
| Type | Description |
|---|---|
InvalidRoomError
|
If the pseudo-room does not have a valid positive area. |
Note
This method generates a rectangular room layout based on the area of the pseudo-room. The doors are positioned along one side of the rectangle. This function is not complete. Currently it only creates single simple rectangular rooms. Due to possibly complex topology, rectangular rooms may not always be a valid representation. Currently, no topology connections are considered. This function will be improved in future versions.
Source code in src/amr_hub_abm/space/floor.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 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 | |
find_room_by_location(location)
Find the room that contains the given location.
Source code in src/amr_hub_abm/space/floor.py
142 143 144 145 146 147 | |
plot(ax, agents=None)
Plot the floor layout including rooms and doors.
Source code in src/amr_hub_abm/space/floor.py
73 74 75 76 | |
location
Module containing location representation for the AMR Hub ABM simulation.
Location
dataclass
Representation of a location in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/space/location.py
18 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 | |
__repr__()
Return a string representation of the location.
Source code in src/amr_hub_abm/space/location.py
42 43 44 45 46 | |
check_line_of_sight(other, walls)
Check if there is a line of sight to another location, considering walls.
Source code in src/amr_hub_abm/space/location.py
57 58 59 60 61 62 63 64 65 66 67 68 69 | |
distance_to(other)
Calculate the Euclidean distance to another location.
Source code in src/amr_hub_abm/space/location.py
33 34 35 36 37 38 39 40 | |
move(new_x, new_y, new_floor)
Move the location to new coordinates.
Source code in src/amr_hub_abm/space/location.py
27 28 29 30 31 | |
which_room(rooms)
Determine which room the location is in, if any.
Source code in src/amr_hub_abm/space/location.py
48 49 50 51 52 53 54 55 | |
room
Module defining room-related classes for the AMR Hub ABM simulation.
Room
dataclass
Representation of a room in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/space/room.py
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 109 110 111 112 113 114 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
__eq__(other)
Check equality of two rooms based on their unique hash strings.
Source code in src/amr_hub_abm/space/room.py
79 80 81 82 83 | |
__hash__()
Generate a hash for the room based on its unique hash string.
Source code in src/amr_hub_abm/space/room.py
75 76 77 | |
__post_init__()
Post-initialization to validate room attributes.
Source code in src/amr_hub_abm/space/room.py
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 | |
contains_point(point)
Check if a given point is inside the room.
Source code in src/amr_hub_abm/space/room.py
143 144 145 146 147 148 149 | |
create_name_hash()
Create a unique hash for the room based on its name.
Source code in src/amr_hub_abm/space/room.py
93 94 95 | |
create_polygon_hash()
Create a unique hash for the room based on its polygonal region.
Source code in src/amr_hub_abm/space/room.py
85 86 87 88 89 90 91 | |
form_region()
Get the polygonal region of the room based on its walls.
Source code in src/amr_hub_abm/space/room.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
get_door_access_point()
Get a point near one of the room's doors for access.
Source code in src/amr_hub_abm/space/room.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
get_random_point(rng=None, max_attempts=1000)
Get a random point within the room.
Source code in src/amr_hub_abm/space/room.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
plot(ax, agents=None, **kwargs)
Plot the room on a given matplotlib axis.
Source code in src/amr_hub_abm/space/room.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 | |
wall
Module defining wall representation for the AMR Hub ABM simulation.
Wall
dataclass
Representation of a wall in the AMR Hub ABM simulation.
Source code in src/amr_hub_abm/space/wall.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
line
property
Get the line representation of the wall.
polygon
property
Get the polygon representation of the wall based on its thickness.
plot(ax, **kwargs)
Plot the wall on a given matplotlib axis.
Source code in src/amr_hub_abm/space/wall.py
28 29 30 31 | |
task
Module for AMR Hub ABM tasks.
Task
dataclass
Representation of a task assigned to an agent.
Source code in src/amr_hub_abm/task.py
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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
__post_init__()
Post-initialization to validate task attributes.
Source code in src/amr_hub_abm/task.py
82 83 84 85 86 87 88 89 90 | |
__repr__()
Representation of the task.
Source code in src/amr_hub_abm/task.py
126 127 128 129 130 131 132 | |
time_spent(current_time)
Calculate the time spent on the task so far.
Source code in src/amr_hub_abm/task.py
72 73 74 75 76 77 78 79 80 | |
update_progress(current_time, agent)
Update the progress of the task based on time spent.
Source code in src/amr_hub_abm/task.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
TaskAttendPatient
dataclass
Bases: Task
Representation of an 'attend patient' task.
Source code in src/amr_hub_abm/task.py
148 149 150 151 152 153 154 155 156 157 158 | |
__post_init__()
Post-initialization to set the task location.
Source code in src/amr_hub_abm/task.py
155 156 157 158 | |
TaskDoorAccess
dataclass
Bases: Task
Representation of a 'door access' task.
Source code in src/amr_hub_abm/task.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
__post_init__()
Post-initialization to set the task location.
Source code in src/amr_hub_abm/task.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
TaskGotoLocation
dataclass
Bases: Task
Representation of a 'goto location' task.
Source code in src/amr_hub_abm/task.py
135 136 137 138 139 140 141 142 143 144 145 | |
__post_init__()
Post-initialization to set the task location.
Source code in src/amr_hub_abm/task.py
142 143 144 145 | |
TaskPriority
Bases: Enum
Enumeration of possible task priority levels.
Source code in src/amr_hub_abm/task.py
47 48 49 50 51 52 | |
TaskProgress
Bases: Enum
Enumeration of possible task progress states.
Source code in src/amr_hub_abm/task.py
20 21 22 23 24 25 26 27 | |
TaskType
Bases: Enum
Enumeration of possible task types.
Source code in src/amr_hub_abm/task.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
TaskWorkstation
dataclass
Bases: Task
Representation of a 'workstation' task.
Source code in src/amr_hub_abm/task.py
186 187 188 189 190 191 192 193 194 195 196 | |
__post_init__()
Post-initialization to set the task location.
Source code in src/amr_hub_abm/task.py
193 194 195 196 | |