NREL / routee-compass

An energy-aware routing engine
https://nrel.github.io/routee-compass/
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

Query starting soc not propagating to state model #241

Closed nreinicke closed 2 months ago

nreinicke commented 4 months ago

If I pass a query that looks like this:

[
    {
        "origin_x": -104.969307,
        "origin_y": 39.779021,
        "destination_x": -104.975360,
        "destination_y": 39.693005,
        "model_name": "2017_CHEVROLET_Bolt",
        "starting_soc_percent": 80,
    },
]

The resulting state model does not honor the setting of starting soc percent:

{'battery_state': {'format': {'floating_point': {'initial': 100.0}},
  'type': 'soc',
  'unit': 'percent'},
 'distance': {'distance_unit': 'miles', 'initial': 0.0},
 'energy_electric': {'energy_unit': 'kilowatt_hours', 'initial': 0.0},
 'time': {'initial': 0.0, 'time_unit': 'minutes'}}

When we are initializing the state model we use the default value of 100% and the starting soc percent does not get set properly.

robfitzgerald commented 2 months ago

@nreinicke correct me if i'm wrong, but, your example doesn't look like a traversal_summary, but instead, a state_model. note how the distance, energy and time are all zeros:

{'battery_state': {'format': {'floating_point': {'initial': 100.0}},
  'type': 'soc',
  'unit': 'percent'},
 'distance': {'distance_unit': 'miles', 'initial': 0.0},
 'energy_electric': {'energy_unit': 'kilowatt_hours', 'initial': 0.0},
 'time': {'initial': 0.0, 'time_unit': 'minutes'}}
nreinicke commented 2 months ago

Oops yeah that's a typo, but the issue is that the initial number for battery state should be 80 rather than 100 since it should be overridden by the starting_soc_percent