Building Dataclass
Module containing building representation for the AMR Hub ABM simulation.
This module defines the Building class, which represents a building in the AMR Hub ABM
simulation. The Building class contains a list of Floor objects and provides methods
for plotting the building layout and sorting/numbering buildings by name.
Building
dataclass
Representation of a building in the AMR Hub ABM simulation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the building. |
required |
floors
|
list[Floor]
|
The list of floors in the building. |
required |
Source code in src/amr_hub_abm/spatial/building.py
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 | |
plot_building(axes, agents=None, *, trajectory=False)
Plot the building layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axes
|
list[Axes]
|
The list of matplotlib axes to plot on. |
required |
agents
|
list[Agent] | None
|
The list of agents to plot. Defaults to None. |
None
|
trajectory
|
bool
|
Whether to plot the trajectory of the agents. Defaults to False. |
False
|
Source code in src/amr_hub_abm/spatial/building.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
sort_and_number_buildings(buildings)
staticmethod
Sort and number buildings by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
buildings
|
list[Building]
|
The list of buildings to sort and number. |
required |
Returns:
| Type | Description |
|---|---|
list[Building]
|
The sorted and numbered list of buildings. |
Source code in src/amr_hub_abm/spatial/building.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |