Update yaml config serialization
At the end of a hive simulation, we dump the configuration as a yaml file into the outputs folder with this method. .
Some of the outputs are getting written as python objects which makes it harder to read and more fragile for future updates. See the end of this post for a sample of the denver demo config written to the outputs.
Any place in which we're dumping something like !!python/object/new:nrel.hive.model.sim_time.SimTime, we should replace it with an alternative. In the case of the sim time, it might be the most readable to call SimTime.as_iso_time(). The paths should be in resolved absolute strings. All of the ScheduleType, ChargingSearchType, ReportType should be in strings, similar to how they're represented in the default config.
cache:
vehicles_file: c9f80fdd3c6a26847a538f084b50b91f
requests_file: 51313b72da195bd8051f3a04635efac7
bases_file: f123fd56f0fcb3e0eb9964ed946ff381
stations_file: 09dc534381e9f53ac355bfc1a00dceb4
mechatronics_file: 41981f6ff597eb30f18e402aca7c07f3
chargers_file: b88c43493a3855744aa34968a7462f5f
schedules_file: 03b159c8e80cf0370d53738dcef2c76c
road_network_file: bd62911410c5ae8a8b9a07267e61041f
geofence_file: 3faec09934271450dec5a418b6407128
rate_structure_file: 230a428bc166cd3c6c225071d0367dec
charging_price_file: 2c8c6a8521d91b86a7753a45de1da6e6
demand_forecast_file: 9a0a74e0388ae02c8ed93e77aa80fbdb
global_config:
global_settings_file_path: /Users/nreinick/.hive.yaml
output_base_directory: /Users/nreinick/nrel/outputs/hive_results
local_parallelism: 1
local_parallelism_timeout_sec: 60
log_run: false
log_events: false
log_states: false
log_instructions: false
log_stats: true
log_level: INFO
log_sim_config: !!set
? !!python/object/apply:nrel.hive.reporting.report_type.ReportType
- 12
: null
log_station_capacities: false
log_time_step_stats: false
log_fleet_time_step_stats: false
lazy_file_reading: false
wkt_x_y_ordering: true
verbose: true
input_config:
scenario_directory: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown
scenario_file: denver_demo.yaml
vehicles_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/vehicles/denver_demo_vehicles.csv
requests_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/requests/denver_demo_requests.csv
bases_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/bases/denver_demo_bases.csv
stations_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/stations/denver_demo_stations.csv
mechatronics_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/mechatronics/mechatronics.yaml
chargers_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/chargers/default_chargers.csv
schedules_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/schedules/default_schedules.csv
road_network_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/road_network/downtown_denver_network.json
geofence_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/geofence/downtown_denver.geojson
rate_structure_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/service_prices/rate_structure.csv
charging_price_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/charging_prices/denver_charging_prices_by_geoid.csv
demand_forecast_file: /Users/nreinick/dev/miniconda3/envs/hive-evse/lib/python3.10/site-packages/nrel/hive/resources/scenarios/denver_downtown/demand_forecast/denver_demand.csv
fleets_file: null
sim:
sim_name: denver_demo
timestep_duration_seconds: 60
start_time: !!python/object/new:nrel.hive.model.sim_time.SimTime
- 0
end_time: !!python/object/new:nrel.hive.model.sim_time.SimTime
- 86400
sim_h3_resolution: 15
sim_h3_search_resolution: 7
request_cancel_time_seconds: 600
schedule_type: !!python/object/apply:nrel.hive.model.vehicle.schedules.schedule_type.ScheduleType
- 0
network:
network_type: osm_network
default_speed_kmph: 40.0
dispatcher:
default_update_interval_seconds: 600
matching_range_km_threshold: 20
charging_range_km_threshold: 20
charging_range_km_soft_threshold: 50
base_charging_range_km_threshold: 100
ideal_fastcharge_soc_limit: 0.8
max_search_radius_km: 100.0
charging_search_type: !!python/object/apply:nrel.hive.dispatcher.instruction_generator.charging_search_type.ChargingSearchType
- 1
human_driver_off_shift_charge_target: 1.0
idle_time_out_seconds: 1800
valid_dispatch_states: !!python/tuple
- idle
- repositioning
scenario_output_directory: !!python/object/apply:pathlib.PosixPath
- /
- Users
- nreinick
- nrel
- outputs
- hive_results
- denver_demo_2023-04-07_10-33-03
I can take a look at this.