Data logger

Submodules

Data logger

class fleetrl.utils.data_logger.data_logger.DataLogger(episode_length)[source]

Bases: object

Logs data to allow for postprocessing, graphs, etc. The log is a dataframe, where each row can be a float or an array. Deepcopy to avoid risk of mutability (logs pointing back to changing variables)

log_data(time, obs, action, reward, cashflow, penalty, grid, soc_v, degradation, charge_log, soh)[source]

While the env object is the same, the episode counter will recognise different episodes. A dict is created with the required values, and then appended to the log dataframe

Parameters:
  • time (Timestamp) – Current timestamp

  • obs (ndarray) – Observation array

  • action (ndarray) – Action array

  • reward (float) – Reward float

  • cashflow (float) – in EUR

  • penalty (float) – penalty float

  • grid (float) – Grid connection in kW

  • soc_v (float) – Amount of SOC violated in # of batteries

  • degradation (float) – Degradation in that timestep

  • charge_log (ndarray) – How much energy flowed into the batteries in kWh

  • soh (ndarray) – Current SoH, array

Returns:

None