NREL / hive

HIVE™ is a mobility services research platform
https://nrelhive.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

[Discussion] Improve state and event logging #157

Open nreinicke opened 1 year ago

nreinicke commented 1 year ago

For both state and event logs, at each time step, we log the reports to a log file that we open at the start of the simulation.

Each of these reports get written to the logs as a single json line like the below for a vehicle state event.

{"vehicle_id": "v13", "memberships": "", "vehicle_state": "ChargingStation", "balance": 511.2542478929938, "distance_traveled_km": 340.20714338784205, "energy_ELECTRIC": 13.58399203772548, "link_link_id": "176107959-176080957", "link_geoid": "8f268cdacadc186", "sim_time": "1970-01-01T17:51:00", "report_type": "VEHICLE_STATE"}

Some downsides of this approach are:

This issue is intended as a discussion for ways to improve the reporting and then we can implement more issues for the ideas that come from it.

nreinicke commented 1 year ago

One idea is that we could at least write each report type to a dedicated file (rather than a single log file for all states and all events). In that way, we would eliminate the report_type information, and, we could write to file in different formats, like csv, since the report keys will always be the same for each report type.