Is your feature request related to a problem? Please describe.
In the current implementation, ChargingNetwork.unplug() takes only station_id as an argument and unplugs whatever EV is connected to that station. However, this poses a problem if the EV is not actually at that EVSE, for example if we all the EV to swap with another EV after it is finished charging.
Describe the solution you'd like
The easiest approach is to include session_id as an argument (it is already included in the UnplugEvent), and just check if that session_id matches the session_id of the EV connected to the station.
This is not the most elegant solution, but it prevents us needing to invalidate previously serialized simulations.
Describe alternatives you've considered
My preferred approach is that instead of taking in a station_id string, unplug() should take in an EV object. It can then correctly find where that EV is plugged in and unplug it as needed.
The main challenge for this is that we are updating what is stored in an UnplugEvent which would cause problems if we want to deserialize from a previous version. Because of this potentially serious issue, I recommend the first option.
Is your feature request related to a problem? Please describe. In the current implementation,
ChargingNetwork.unplug()
takes onlystation_id
as an argument and unplugs whatever EV is connected to that station. However, this poses a problem if the EV is not actually at that EVSE, for example if we all the EV to swap with another EV after it is finished charging.Describe the solution you'd like The easiest approach is to include
session_id
as an argument (it is already included in theUnplugEvent
), and just check if thatsession_id
matches thesession_id
of the EV connected to the station.This is not the most elegant solution, but it prevents us needing to invalidate previously serialized simulations.
Describe alternatives you've considered My preferred approach is that instead of taking in a
station_id
string,unplug()
should take in anEV
object. It can then correctly find where that EV is plugged in and unplug it as needed.The main challenge for this is that we are updating what is stored in an
UnplugEvent
which would cause problems if we want to deserialize from a previous version. Because of this potentially serious issue, I recommend the first option.