Пример #1
0
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List <Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (route == null)
            {
                throw new ArgumentNullException("route");
            }
            if (route.Vehicle == null)
            {
                throw new InvalidOperationException("Vehicle not set on route: Cannot generate instruction for a route without a vehicle!");
            }
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }
            if (languageGenerator == null)
            {
                throw new ArgumentNullException("languageGenerator");
            }

            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(interpreter);
            AggregatedPoint point =
                aggregator.Aggregate(route);

            return(InstructionGenerator.Generate(point, interpreter, languageGenerator));
        }
 /// <summary>
 /// Calculates metrics for the given route.
 /// </summary>
 /// <param name="route"></param>
 /// <returns></returns>
 public Dictionary<string, double> Calculate(Route route)
 {
     OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
         new OsmSharp.Routing.ArcAggregation.ArcAggregator(_interpreter);
     AggregatedPoint p = aggregator.Aggregate(route);
     return this.Calculate(route.Vehicle, p);
 }
Пример #3
0
        /// <summary>
        /// Calculates metrics for the given route.
        /// </summary>
        /// <param name="route"></param>
        /// <returns></returns>
        public Dictionary <string, double> Calculate(Route route)
        {
            var aggregator = new OsmSharp.Routing.ArcAggregation.ArcAggregator(_interpreter);
            var p          = aggregator.Aggregate(route);

            return(this.Calculate(Vehicle.GetByUniqueName(route.Vehicle), p));
        }
Пример #4
0
        /// <summary>
        /// Calculates metrics for the given route.
        /// </summary>
        /// <param name="route"></param>
        /// <returns></returns>
        public Dictionary <string, double> Calculate(OsmSharpRoute route)
        {
            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(_interpreter);
            AggregatedPoint p = aggregator.Aggregate(route);

            return(this.Calculate(route.Vehicle, p));
        }
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List<Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(interpreter);
            AggregatedPoint point =
                aggregator.Aggregate(route);

            return InstructionGenerator.Generate(point, interpreter, languageGenerator);
        }
Пример #6
0
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List <Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(interpreter);
            AggregatedPoint point =
                aggregator.Aggregate(route);

            return(InstructionGenerator.Generate(point, interpreter, languageGenerator));
        }
Пример #7
0
        /// <summary>
        /// Generates instructions.
        /// </summary>
        /// <param name="route"></param>
        /// <param name="interpreter"></param>
        /// <param name="languageGenerator"></param>
        /// <returns></returns>
        public static List<Instruction> Generate(Route route, IRoutingInterpreter interpreter, ILanguageGenerator languageGenerator)
        {
            if (route == null) { throw new ArgumentNullException("route"); }
            if (route.Vehicle == null) { throw new InvalidOperationException("Vehicle not set on route: Cannot generate instruction for a route without a vehicle!"); }
            if (interpreter == null) { throw new ArgumentNullException("interpreter"); }
            if (languageGenerator == null) { throw new ArgumentNullException("languageGenerator"); }

            OsmSharp.Routing.ArcAggregation.ArcAggregator aggregator =
                new OsmSharp.Routing.ArcAggregation.ArcAggregator(interpreter);
            AggregatedPoint point =
                aggregator.Aggregate(route);

            return InstructionGenerator.Generate(point, interpreter, languageGenerator);
        }
Пример #8
0
 /// <summary>
 /// Calculates metrics for the given route.
 /// </summary>
 /// <param name="route"></param>
 /// <returns></returns>
 public Dictionary<string, double> Calculate(Route route)
 {
     var aggregator =  new OsmSharp.Routing.ArcAggregation.ArcAggregator(_interpreter);
     var p = aggregator.Aggregate(route);
     return this.Calculate(Vehicle.GetByUniqueName(route.Vehicle), p);
 }