ambulance_simulation.ambulance_aid_process#

ambulance_simulation.ambulance_aid_process(env: Environment, assigned_patient: Patient, ambulance: Ambulance, patient_queue: deque, charging_stations: dict[str, dict[str, list[simpy.resources.resource.Resource | float]]], simulation_times: dict[str, numpy.ndarray], to_hospital_bool: ndarray, SIMULATION_PARAMETERS: dict[str, Any], SIMULATION_DATA: dict[str, Any])#

The ambulance aid process.

A patient is helped by the ambulance, after which the ambulance checks whether there are waiting patients that it can help. This repeats until it cannot help any patients in the waiting line. Then, the ambulance drive process is started.

Parameters:
  • env (sp.core.Environment) – The SimPy environment.

  • assigned_patient (Patient) – The patient (object) that was assigned to the ambulance.

  • ambulance (Ambulance) – The ambulance object.

  • patient_queue (deque) – The patient queue.

  • charging_stations (dict[str, dict[str, list[sp.resources.resource.Resource | float]]]) – The charging stations resources at all bases and all hospitals together with their charging speeds.

  • simulation_times (dict[str, np.ndarray]) – Contains the interarrival times, the on-site aid times and the drop-off times.

  • to_hospital_bool (np.ndarray) – Specifies for each patient whether transportation to the hospital is required or not.

  • 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. See main.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.