예제 #1
0
 public VertexConfig( int buf, int bas, int gen, float flratio, FindRoute rtfunc )
 {
     this.buffer = buf;
     this._base = bas;
     this.genLimit = gen;
     this.fullLoadRatio = flratio;
     this.routeFunc = rtfunc;
 }
예제 #2
0
        public void TestMethod1()
        {
            FindRoute findRoute = new FindRoute();

            var x = findRoute.GetResultPaths(7, 3, new DateTime(2017, 10, 4), new DateTime(2017, 10, 28));


            findRoute = new FindRoute();
            var y = findRoute.GetResultPaths(4, 2, new DateTime(2017, 10, 4), new DateTime(2017, 10, 28));

            //string x = "3.23.2018 06:00:00";
            //var y = DateTime.ParseExact(x, "M.d.yyyy HH:mm:ss", CultureInfo.InvariantCulture);
        }
예제 #3
0
        static void TestRouteBetween()
        {
            Console.WriteLine("Route Between");

            var src  = new Node("a");
            var dest = new Node("b");

            src.Children = new List <Node> {
                new Node("c"),
                new Node("d"),
                new Node("e")
            };
            var inter = new Node("f");

            inter.Children.Add(dest);
            src.Children.Add(inter);

            Console.WriteLine(FindRoute.FindRouteBetween(src, dest));
        }
        public async Task <IActionResult> GetTrips([FromQuery] string Dep,
                                                   [FromQuery] string Dest,
                                                   [FromQuery] string Time)
        {
            HttpResponseMessage response = await cl.GetAsync(filename);

            response.EnsureSuccessStatusCode();
            var responseBody = await response.Content.ReadAsStringAsync();

            List <Route> RouteList = JsonSerializer.Deserialize <List <Route> >(responseBody);

            var planner = new FindRoute(RouteList);
            var trip    = planner.GetTrip(Dep, Dest, Time);

            if (trip != null)
            {
                return(Ok(trip));
            }
            else
            {
                return(NotFound("No trip found"));
            }
        }