/********************************************************************************************/ /********************************************************************************************/ /*** ***/ /*** PLAN ***/ /*** ***/ /********************************************************************************************/ /********************************************************************************************/ //used when trying to recover a plan where the agent is not on a platform and state of the plan public PathPlan joinPlans(PathPlan correction, PathPlan original, Point connectionPoint) { List <Point> points = original.getPathPoints(); int i; for (i = 0; i < points.Count; i++) { if (points[i].getPosX() == connectionPoint.getPosX() && points[i].getPosY() == connectionPoint.getPosY() && points[i].getUncaughtColl().Count == connectionPoint.getUncaughtColl().Count) { break; } } for (int j = i; j < points.Count; j++) { correction.addPoint(points[j]); } return(correction); }