EV charging

Submodules

EV charger

class fleetrl.utils.ev_charging.ev_charger.EvCharger(ev_conf)[source]

Bases: object

The EV Charger class handles the logic from action to battery charging. SOC and charging cost are calculated. Two different cost scenarios can be modelled: spot market in both directions (allowing for arbitrage) and a commercial electricity tariff that takes into account grid fees, and markups. Discharging at PV feed-in levels.

charge(db, num_cars, actions, episode, load_calculation, ev_conf, time_conf, score_conf, print_updates, target_soc)[source]

The function loops through each car separately and computes SOC and charging cost depending on the action. Positive actions -> charging, negative actions -> discharging. Penalties are taken into account if the battery would be overcharged (agent sends a charging action to a full battery).

Parameters:
  • db (DataFrame) – The schedule database of the EVs

  • num_cars (int) – Number of cars in the model

  • actions – Actions taken by the agent

  • episode (Episode) – Episode object with its parameters and functions

  • load_calculation (LoadCalculation) – Load calc object with its parameters and functions

  • ev_conf (EvConfig) – Config of the EVs

  • time_conf (TimeConfig) – Time configuration

  • score_conf (ScoreConfig) – Score and penalty configuration

  • print_updates (bool) – Bool whether to print statements or not (maybe lower fps)

  • target_soc (list) – target soc for each car

Returns:

soc, next soc, the reward and the monetary value (cashflow)