Open lewie-donckers opened 2 years ago
At this moment I am not sure if this was the intended behavior at the moment of coding that piece, but I would say the current behavior is actually desirable. The idea is to make progress along the path, so if we find a better position ahead of us, we should not look backwards. So we should make this more explicit in the implementation.
While refactoring
Controller::findPositionOnPlan()
, I noticed the following. I'm not sure if it is intended or not so I would like some feedback. Depending on the feedback we can determine what to do (nothing, document, fix, etc).In that function we look ahead in the plan based on a given index. As long as each next point is a better match, we keep looking and update the given index. Once we're done with looking ahead, we start looking backward. Now one of two things will happen:
So in practice we look either forward or backward but never both. Is this intended?
I've included the code below and stripped the bits that were less relevant: