/// <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"); } var aggregator = new ArcAggregator(interpreter); var point = aggregator.Aggregate(route); return InstructionGenerator.Generate(route, point, interpreter, languageGenerator); }
/// <summary> /// Generates instructions. /// </summary> /// <param name="planner"></param> /// <param name="route"></param> /// <returns></returns> public static List <Instruction> Generate(MicroPlanner planner, Route route) { if (route == null) { throw new ArgumentNullException("route"); } var aggregator = new ArcAggregator(planner.Interpreter); var point = aggregator.Aggregate(route); if (point == null) { // returns an empty list because of an empty route. return(new List <Instruction>()); } return(InstructionGenerator.Generate(planner, route, point)); }
/// <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"); } var aggregator = new ArcAggregator(interpreter); var point = aggregator.Aggregate(route); return(InstructionGenerator.Generate(route, point, interpreter, languageGenerator)); }
/// <summary> /// Generates instructions. /// </summary> /// <param name="planner"></param> /// <param name="route"></param> /// <returns></returns> public static List<Instruction> Generate(MicroPlanner planner, Route route) { if (route == null) { throw new ArgumentNullException("route"); } var aggregator = new ArcAggregator(planner.Interpreter); var point = aggregator.Aggregate(route); if(point == null) { // returns an empty list because of an empty route. return new List<Instruction>(); } return InstructionGenerator.Generate(planner, route, point); }