Open nreinicke opened 1 month ago
note: wrote this, then talked myself out of it, leaving it here for posterity.
had a thought about this. still thinking that the right path is an enum. wondering if there's a smart way to do this more generally, since we are proposing this work in the base repo. could we reduce the above into:
#[derive(Serialize, Deserialize)]
pub enum VehicleRestriction {
EdgeWeightRestriction(???),
EdgeDistanceRestriction(???),
// ... other units
NumericClassRestriction(u8),
TrajectoryRestriction(Vec<EdgeId>)
}
downstream, a user could compose these as a CombinedFrontierModel
.
thing is, that stuff in the ???
would need to be open enough in it's design to handle things like "expect a number on the query at the key axles
, then multiply that by a key weight
, and then do a <= operation."
eh, that's writing a whole nuther DSL, and it sounds awesome, but maybe that's future work to revisit later.
PR #204 introduced the concept of the VehicleRestriction.
@robfitzgerald points out that: