Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Improve state and event logging #157

Open
nreinicke opened this issue Apr 22, 2023 · 1 comment
Open

[Discussion] Improve state and event logging #157

nreinicke opened this issue Apr 22, 2023 · 1 comment
Milestone

Comments

@nreinicke
Copy link
Collaborator

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:

  • performance hit writing to file at each time step
  • difficulty parsing the results afterwards since each entry into the log can have different entries for different report types
  • large file sizes for big simulations

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 nreinicke added this to the PyCon 2023 milestone Apr 22, 2023
@nreinicke
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant