Exemplo n.º 1
0
        /// <summary>
        /// Builds a route.
        /// </summary>
        public static Result <Route> TryBuild(RouterDb db, Profile profile, Func <ushort, Profiles.Factor> getFactor, RouterPoint source, RouterPoint target, EdgePath <float> path)
        {
            var pathList = new List <uint>();

            path.AddToListAsVertices(pathList);
            return(FastRouteBuilder.TryBuild(db, profile, getFactor, source, target, pathList));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds a route.
        /// </summary>
        public static Result <Route> TryBuild(RouterDb db, Profile profile, Func <ushort, Profiles.Factor> getFactor,
                                              RouterPoint source, RouterPoint target, List <uint> path)
        {
            var routeBuilder = new FastRouteBuilder(db, profile, getFactor, source, target, path);

            routeBuilder.Run();
            if (!routeBuilder.HasSucceeded)
            {
                return(new Result <Route>(
                           string.Format("Failed to build route: {0}", routeBuilder.ErrorMessage)));
            }
            return(new Result <Route>(routeBuilder.Route));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Builds a route.
 /// </summary>
 public static Route Build(RouterDb db, Profile profile, Func <ushort, Profiles.Factor> getFactor, RouterPoint source, RouterPoint target, List <uint> path)
 {
     return(FastRouteBuilder.TryBuild(db, profile, getFactor, source, target, path).Value);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Builds a route.
 /// </summary>
 public static Result <Route> TryBuild(RouterDb db, Profile profile, Func <ushort, Profiles.Factor> getFactor,
                                       RouterPoint source, RouterPoint target, List <uint> path)
 {
     return(FastRouteBuilder.TryBuild(db, profile, getFactor, source, target, path, CancellationToken.None));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Builds a route.
 /// </summary>
 public static Route Build(RouterDb db, Profile profile, Func <ushort, Profiles.Factor> getFactor, RouterPoint source, RouterPoint target, EdgePath <float> path,
                           CancellationToken cancellationToken)
 {
     return(FastRouteBuilder.TryBuild(db, profile, getFactor, source, target, path, cancellationToken).Value);
 }