Exceptions Class Reference
Module defining all custom exceptions for the AMR Hub ABM simulation.
The exceptions defined in this module are
- SimulationModeError: When an operation is invalid for the given simulation mode.
- InvalidDistanceError: When an invalid distance calculation is attempted.
- TimeError: When a negative time value is encountered.
- InvalidRoomError: When a room is defined with invalid parameters.
- InvalidDoorError: When a door is defined with invalid parameters.
- InvalidDefinitionError: When a general invalid definition is encountered.
InvalidDefinitionError
Bases: Exception
Exception raised when a general invalid definition is encountered.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
A description of the error that occurred. |
Source code in src/amr_hub_abm/exceptions.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
__init__(message)
Initialize the InvalidDefinitionError.
Source code in src/amr_hub_abm/exceptions.py
134 135 136 | |
InvalidDistanceError
Bases: Exception
Exception raised when an invalid distance calculation is attempted.
This exception is used to indicate that a distance calculation between two locations is invalid, either because the locations are not compatible (e.g., different buildings).
Attributes:
| Name | Type | Description |
|---|---|---|
locations |
tuple
|
A tuple containing the two locations involved in the distance calculation. |
building |
bool
|
A flag indicating whether the distance calculation is between buildings (True) or floors (False). |
Source code in src/amr_hub_abm/exceptions.py
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 | |
__init__(locations, building)
Initialize the InvalidDistanceError.
Source code in src/amr_hub_abm/exceptions.py
54 55 56 57 58 59 60 61 62 63 64 65 | |
InvalidDoorError
Bases: Exception
Exception raised when a door is defined with invalid parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
A description of the error that occurred. |
Source code in src/amr_hub_abm/exceptions.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
__init__(message)
Initialize the InvalidDoorError.
Source code in src/amr_hub_abm/exceptions.py
118 119 120 | |
InvalidRoomError
Bases: Exception
Exception raised when a room is defined with invalid parameters.
This exception is used to indicate that a room definition is invalid, either because of missing parameters, incompatible parameters, or other issues with the room definition.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
A description of the error that occurred. |
Source code in src/amr_hub_abm/exceptions.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
__init__(message)
Initialize the InvalidRoomError.
Source code in src/amr_hub_abm/exceptions.py
102 103 104 | |
LocationDataValidationError
Bases: Exception
Exception raised when location-event input fails preflight validation.
Source code in src/amr_hub_abm/exceptions.py
155 156 157 158 159 160 161 162 163 164 165 166 167 | |
__init__(errors, warnings=())
Initialize the error with all collected validation findings.
Source code in src/amr_hub_abm/exceptions.py
158 159 160 161 162 163 164 165 166 167 | |
NonNegativeValueError
Bases: Exception
Exception raised when a non-negative value is expected but not provided.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
A description of the error that occurred. |
Source code in src/amr_hub_abm/exceptions.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
__init__(message)
Initialize the NonNegativeValueError.
Source code in src/amr_hub_abm/exceptions.py
150 151 152 | |
SimulationModeError
Bases: Exception
Exception raised when an operation is invalid for the current simulation mode.
This exception is used to indicate that a certain action or operation cannot be performed because it is not compatible with the current simulation mode.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
A description of the error that occurred. |
Source code in src/amr_hub_abm/exceptions.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
__init__(message)
Initialize the SimulationModeError.
Source code in src/amr_hub_abm/exceptions.py
29 30 31 | |
TimeError
Bases: Exception
Exception raised when a negative time value is encountered.
This exception is used to indicate that a time value provided to a function or method is negative, which is invalid in the context of the simulation.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str
|
A description of the error that occurred. |
Source code in src/amr_hub_abm/exceptions.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
__init__(message)
Initialize the TimeError.
Source code in src/amr_hub_abm/exceptions.py
82 83 84 | |