ambulance.Ambulance.check_patient_reachable#
- Ambulance.check_patient_reachable(ambulance_location_ID: int, patient_location_ID: int, hospital_location_ID: int, charging_stations_hospitals: dict[str, list[simpy.resources.resource.Resource | float]], SIMULATION_PARAMETERS: dict[str, Any], SIMULATION_DATA: dict[str, Any]) bool #
Checks whether the patient is reachable for the ambulance.
The patient is always reachable for a diesel vehicle, but for an electric vehicle, the current battery level is taken into account. Whether the ambulance is currently driving or charging is also taken into account. See the paper by Dieleman and Jagtenberg for the procedure that is used to determine whether a patient is reachable.
- Parameters:
ambulance_location_ID (int) – The current location ID of the ambulance.
patient_location_ID (int) – The arrival location of the patient.
hospital_location_ID (int) – The assigned hospital (in case the patient needs to be transported).
charging_stations_hospitals (dict[str, list[sp.resources.resource.Resource | float]) – The charging stations resources at all hospitals together with their charging speeds.
SIMULATION_PARAMETERS (dict[str, Any]) – The simulation parameters. The parameter
PRINT
is at least necessary. Note that methods that are called within this method may require more parameters. Seemain.py
for parameter explanations.SIMULATION_DATA (dict[str, Any]) – The simulation data. Methods that are called within this method require data. See these methods for explanations.
- Raises:
Exception –
If the ambulance is driving and charging at the same time. 2. If an invalid
ENGINE_TYPE
is specified.
- Returns:
bool – Whether the patient is reachable or not.