ambulance_simulation.py#

This file contains the code for running the simulation.

initialize_simulation(SIMULATION_PARAMETERS, ...)

Initializes all data and required objects of the simulation.

generate_service_times(s, loc, scale, rng, ...)

Generates service times from the lognormal distribution.

generate_interarrival_times_process_type_time(...)

Generates the interarrival times if PROCESS_TYPE='Time'.

run_simulation(SIMULATION_PARAMETERS, ...)

Performs a single simulation run.

charging_stations_initialization(env, ...)

Initializes the charging stations dictionary.

ambulance_initialization(env, ...)

Initializes the ambulances and saves these in a list.

patient_generator(env, ambulances, ...)

Generates new patients and starts their aid process.

location_generator(rng, ...)

Generates the patient arrival locations.

patient_arrival(env, patient_ID, ...)

Processes a patient arrival.

help_waiting_patients(env, ambulances, ...)

Checks in time intervals whether there are waiting patients that can be helped by ambulances.

ambulance_aid_process(env, assigned_patient, ...)

The ambulance aid process.

ambulance_drive_process(env, ambulance, ...)

The ambulance drive process to its base.

check_select_ambulance(env, ambulances, ...)

Checks whether ambulances are available.

select_hospital(source_location_ID, ...)

Selects the closest hospital based on a source location.