Closed nreinicke closed 3 weeks ago
right. this was supposed to be solved by the "state" section of the "route" object:
"state_model": {
"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"
}
}
but i'm realizing the index is missing from each object. or, since it's a map, we can't guarantee ordering. so, i think that means this task is either to add the index (explicitly):
"battery_state": {
"index": 0,
"format": {
"floating_point": {
"initial": 100.0
}
},
"type": "soc",
"unit": "percent"
}
or make these an array (index implicit):
"state_model": [
{
"name": "battery_state",
"format": {
"floating_point": {
"initial": 100.0
}
},
"type": "soc",
"unit": "percent"
}
]
thoughts?
Yeah those are both good solutions. I think I would favor adding the index into the entry explicitly since it makes it obvious what it means.
Addressed via #251.
Looking at an example path returned from compass:
~It's not immediately clear what value is what in
result_state
. While we can cross reference this information fromresult.route.state_model
,~It's impossible to tell which value is which in
result_state
since the indices are not captured directly in the result.it might be more ergonomic to have them in the path directly, maybe something like
result_state_{state_feature}_{state_feature_unit}
.