Fixing EV random event generator
This addresses 2 bugs related to assigning EV charging events:
- The random seed wasn't working, because events were generated before the seed was set. This is fixed.
- There was no way to specify the event data, for example using the same events for Level 1/Level 2 chargers. The event data file is now an input.
No assigned issue. @JingWang-CUB raised this privately (see panel-tea branch).
- [x] Reference the issue your PR is fixing
- [x] Assign at least 1 reviewer for your PR
- [x] Test with run_dwelling.py or other script
- [x] Update documentation as appropriate
- [x] Update changelog as appropriate
@JingWang-CUB, feel free to cherry pick https://github.com/NREL/OCHRE/pull/122/commits/2a29228b7eafe8fd6ba3c92ae58a6fbb6ffdc874 in your branch. You'll need that update, plus updated inputs, to fix your issue.
One note about using the same event data - the data is generated based on assumed home charging level. I think people with Level 1 chargers tend to charge more often, and maybe arrive with lower SOC. Up to you if you want to use the Level 1 or Level 2 event data, but it's good to understand this limitation with the analysis.
@mnblonsky: When you get a chance to update the documentation let me know and I'll approve. Change itself looks fine
Hi @mnblonsky , here are my testing results:
- With the same seed value, OCHRE now generates the same EV events for the same charging level, but varying the charging level still generates different events.
- When using the
equipment_event_fileinput with an output file from a level 2 charger (e.g., EV_events.csv), I got the following error:This is caused by the start_time in the result file written as a string instead of a float. Is there a quick way to fix this? Thanks!
Oh sorry, the equipment_event_file should be one of the default files from OCHRE. See https://github.com/NREL/OCHRE/tree/main/defaults/EV
This is now working. I misunderstood how the equipment_event_file was used. Now everything looks good.