public Route get_van_route(int van_id) { var db = Database.Open("vane"); // we want to get van_route. First and foremost, check that this van_id exists if (db.QueryValue("SELECT Count (*) FROM recent_reading WHERE van_id = @0", van_id) == 0) { return(new Route()); } // check that the last check in time was less than 30 seconds. // TODO(emad): since we're not gonna have live data to demo, so avoid doing this, now var q = db.QuerySingle("SELECT lon, lat, time FROM recent_reading WHERE van_id = @0", van_id); Coord last_seen = new Coord(Convert.ToDouble(q.lat), Convert.ToDouble(q.lon)); db.Close(); // now check if this van's data has already been loaded - should be true. if (van_route.ContainsKey(van_id)) { return(van_route[van_id].get_sub_route(last_seen)); } else { FullRoute fr = new FullRoute(van_id); van_route[van_id] = fr; return(fr.get_sub_route(last_seen)); } }
/// <summary> /// Constructor /// </summary> /// <param name="localRoute"></param> /// <param name="bestFullRoute"></param> /// <param name="vehicleState"></param> /// <param name="maneuver"></param> public AiRemoteListener(Routes localRoute, FullRoute bestFullRoute, VehicleState vehicleState, Behavior behavior, IPath path, DynamicObstacles dynamicObstacles, StaticObstacles staticObstacles) { this.LocalRoute = localRoute; this.BestFullRoute = bestFullRoute; this.VehicleState = vehicleState; this.behavior = behavior; this.path = path; this.DynamicObstacles = dynamicObstacles; this.StaticObstacles = staticObstacles; }
/// <summary> /// Constructor /// </summary> /// <param name="currentArbiterState"></param> /// <param name="internalCarMode"></param> /// <param name="fullRoute"></param> /// <param name="routeTime"></param> /// <param name="actionPoint"></param> /// <param name="currentGoal"></param> /// <param name="goals"></param> /// <param name="behavior"></param> public ArbiterInformation(string currentArbiterState, CarMode internalCarMode, FullRoute fullRoute, double routeTime, RndfWaypointID actionPoint, RndfWaypointID currentGoal, Queue<RndfWaypointID> goals, Behavior behavior, VehicleState planningState) { this.CurrentArbiterState = currentArbiterState; this.InternalCarMode = internalCarMode; this.FullRoute = fullRoute; this.RouteTime = routeTime; this.ActionPoint = actionPoint; this.CurrentGoal = currentGoal; this.Goals = goals; this.Behavior = behavior; this.PlanningState = planningState; }
public void new_reading(Coord c, int van_id) { if (van_route.ContainsKey(van_id)) { van_route[van_id].update_new_loc(c); } else { FullRoute fr = new FullRoute(van_id); van_route[van_id] = fr; van_route[van_id].update_new_loc(c); } }
/// <summary> /// Constructor /// </summary> /// <param name="currentArbiterState"></param> /// <param name="internalCarMode"></param> /// <param name="fullRoute"></param> /// <param name="routeTime"></param> /// <param name="actionPoint"></param> /// <param name="currentGoal"></param> /// <param name="goals"></param> /// <param name="behavior"></param> public ArbiterInformation(string currentArbiterState, CarMode internalCarMode, FullRoute fullRoute, double routeTime, RndfWaypointID actionPoint, RndfWaypointID currentGoal, Queue <RndfWaypointID> goals, Behavior behavior, VehicleState planningState) { this.CurrentArbiterState = currentArbiterState; this.InternalCarMode = internalCarMode; this.FullRoute = fullRoute; this.RouteTime = routeTime; this.ActionPoint = actionPoint; this.CurrentGoal = currentGoal; this.Goals = goals; this.Behavior = behavior; this.PlanningState = planningState; }
/// <summary> /// Constructor /// </summary> /// <param name="expandedRoute"></param> /// <param name="localRoute"></param> public Route(FullRoute expandedRoute, LocalRoute localRoute, Goal goal) { this.expandedRoute = expandedRoute; this.localRoute = localRoute; this.goal = goal; }
public RouteDisplay(RndfNetwork rndf, FullRoute route) { this.rndf = rndf; this.route = route; }