/// <summary> /// Plan given that we are starting on a road /// </summary> /// <param name="currentLane"></param> /// <param name="currentPosition"></param> /// <param name="goal"></param> /// <returns></returns> public RoadPlan PlanNavigableArea(INavigableTravelArea currentArea, Coordinates currentPosition, INavigableNode goal, List <ArbiterWaypoint> ignorable) { // get all downstream points of interest as well as the goal point of interest List <DownstreamPointOfInterest> downstreamPoints = currentArea.Downstream(currentPosition, ignorable, goal); // so, for each exit downstream we need to plan from the end of each interconnect to the goal this.RouteTimes(downstreamPoints, goal); // get road plan RoadPlan rp = this.GetRoadPlan(downstreamPoints); #region Output // update arbiter information List <RouteInformation> routeInfo = rp.RouteInformation(currentPosition); // make sure we're in a road state if (CoreCommon.CorePlanningState == null || CoreCommon.CorePlanningState is UrbanChallenge.Arbiter.Core.Common.State.TravelState) { // check route 1 if (routeInfo.Count > 0) { RouteInformation ri = routeInfo[0]; CoreCommon.CurrentInformation.Route1 = ri; CoreCommon.CurrentInformation.Route1Time = ri.RouteTimeCost.ToString("F6"); CoreCommon.CurrentInformation.Route1Wp = ri.Waypoint; } } #endregion // return road plan return(rp); }
/// <summary> /// Seed the road planner /// </summary> /// <param name="seedLane"></param> /// <param name="seedPosition"></param> /// <param name="goal"></param> /// <param name="ignorable"></param> public void SeedRoadPlanner(INavigableTravelArea seed, Coordinates seedPosition, INavigableNode goal, List <ArbiterWaypoint> ignorable) { // get all downstream points of interest List <DownstreamPointOfInterest> downstreamPoints = seed.Downstream(seedPosition, ignorable, goal); // so, for each exit downstream we need to plan from the end of each interconnect to the goal this.SeedPlanner(downstreamPoints, goal); }
/// <summary> /// Seed the road planner /// </summary> /// <param name="seedLane"></param> /// <param name="seedPosition"></param> /// <param name="goal"></param> /// <param name="ignorable"></param> public void SeedRoadPlanner(INavigableTravelArea seed, Coordinates seedPosition, INavigableNode goal, List<ArbiterWaypoint> ignorable) { // get all downstream points of interest List<DownstreamPointOfInterest> downstreamPoints = seed.Downstream(seedPosition, ignorable, goal); // so, for each exit downstream we need to plan from the end of each interconnect to the goal this.SeedPlanner(downstreamPoints, goal); }
/// <summary> /// Plan given that we are starting on a road /// </summary> /// <param name="currentLane"></param> /// <param name="currentPosition"></param> /// <param name="goal"></param> /// <returns></returns> public RoadPlan PlanNavigableArea(INavigableTravelArea currentArea, Coordinates currentPosition, INavigableNode goal, List<ArbiterWaypoint> ignorable) { // get all downstream points of interest as well as the goal point of interest List<DownstreamPointOfInterest> downstreamPoints = currentArea.Downstream(currentPosition, ignorable, goal); // so, for each exit downstream we need to plan from the end of each interconnect to the goal this.RouteTimes(downstreamPoints, goal); // get road plan RoadPlan rp = this.GetRoadPlan(downstreamPoints); #region Output // update arbiter information List<RouteInformation> routeInfo = rp.RouteInformation(currentPosition); // make sure we're in a road state if (CoreCommon.CorePlanningState == null || CoreCommon.CorePlanningState is UrbanChallenge.Arbiter.Core.Common.State.TravelState) { // check route 1 if (routeInfo.Count > 0) { RouteInformation ri = routeInfo[0]; CoreCommon.CurrentInformation.Route1 = ri; CoreCommon.CurrentInformation.Route1Time = ri.RouteTimeCost.ToString("F6"); CoreCommon.CurrentInformation.Route1Wp = ri.Waypoint; } } #endregion // return road plan return rp; }