Function hotdrink_rs::planner::hierarchical_planner[][src]

pub fn hierarchical_planner<T, M, C, Comp>(
    component: &Comp
) -> Result<Vec<OwnedEnforcedConstraint<M>>, PlanError> where
    M: MethodSpec<Arg = T> + Clone,
    C: ConstraintSpec<Method = M> + Debug + Clone,
    Comp: ComponentSpec<Constraint = C> + Clone

Take a component as input, as well as a ranking of variables to know which ones should not be modified if possible. The leftmost variables will be prioritized.

This planner repeatedly calls the simple planner with different combinations of stay constraints. The initial plan is just the one with no additional stay constraints to have a default. Then try adding a stay constraint for the leftmost variable (highest priority), and see if the simple planner succeeds. If it does, then keep the stay constraint and move on to the next variable. If it does not succceed, then remove the stay constraint and move on to the next variable.