本文整理汇总了C#中Vehicle.MaxSpeed方法的典型用法代码示例。如果您正苦于以下问题:C# Vehicle.MaxSpeed方法的具体用法?C# Vehicle.MaxSpeed怎么用?C# Vehicle.MaxSpeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle.MaxSpeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildDummyRoute
/// <summary>
/// Builds a dummy route (as the crow flies) for segments of a route not found.
/// </summary>
/// <returns></returns>
public virtual Route BuildDummyRoute(Vehicle vehicle, GeoCoordinate coordinate1, GeoCoordinate coordinate2)
{
var route = new Route();
route.Vehicle = vehicle.UniqueName;
var segments = new RouteSegment[2];
segments[0] = new RouteSegment();
segments[0].Distance = 0;
segments[0].Time = 0;
segments[0].Type = RouteSegmentType.Start;
segments[0].Vehicle = vehicle.UniqueName;
segments[0].Latitude = (float)coordinate1.Latitude;
segments[0].Longitude = (float)coordinate1.Longitude;
var distance = coordinate1.DistanceReal(coordinate2).Value;
var timeEstimage = distance / (vehicle.MaxSpeed().Value) * 3.6;
var tags = new TagsCollection();
tags.Add("route", "not_found");
segments[1] = new RouteSegment();
segments[1].Distance = distance;
segments[1].Time = timeEstimage;
segments[1].Type = RouteSegmentType.Stop;
segments[1].Vehicle = vehicle.UniqueName;
segments[1].Latitude = (float)coordinate2.Latitude;
segments[1].Longitude = (float)coordinate2.Longitude;
segments[1].Tags = RouteTagsExtensions.ConvertFrom(tags);
route.Segments = segments;
return route;
}