ambulance.Ambulance.charge_battery#

Ambulance.charge_battery(selected_charger: Resource, speed_charger: float, required_increase_battery: float, charging_location_ID: int, charging_type: int, SIMULATION_PARAMETERS: dict[str, Any], SIMULATION_DATA: dict[str, Any])#

Charges the ambulance battery and interrupts charging if necessary.

Parameters:
  • selected_charger (sp.resources.resource.Resource) – The charger that was selected to use during charging.

  • speed_charger (float) – The speed of the charger in kW.

  • required_increase_battery (float) – The required battery increase in kWh.

  • charging_location_ID (int) – The charging location ID.

  • charging_type (int) – The charging type. “2” for charging at the base, “1” for charging at the hospital after treating a patient and “0” for charging during patient handover..

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

Raises:

Exception

  1. If there is a queue at the ambulance resource. 2. If the variable charges conflicts with drives_to_base. 3. If the variable charges conflicts with assigned_to_patient and/or helps_patient. 4. If the request was triggered, but the ambulance was not charged.

Returns:

charging_interrupted (bool) – Whether the charging was interrupted or not.