public VertexInDateBase(int id, PointCoordinates coordinates, PriorityVertex priorityVertex, ArcInDateBase[] arcs, int numberZone) { if (coordinates == null || arcs == null) { throw new ArgumentNullException(); } if (arcs.Length == 0) { throw new ArgumentException(); } }
public List<PointCoordinates> GetWay(PointCoordinates coor1, PointCoordinates coor2) { int id1 = dataBase.GetNearId(coor1); int id2 = dataBase.GetNearId(coor2); VertexInDateBase vertexDB1 = dataBase.GetVertex(id1); VertexInDateBase vertexDB2 = dataBase.GetVertex(id2); if (vertexDB1.NumberZone == vertexDB2.NumberZone) { return zones[vertexDB1.NumberZone].GetTrack(id1, id2); } else { // Запускается алгоритм A* throw new Exception("The method or operation is not implemented."); } }
public Vertex(int id, PointCoordinates coordinates, PriorityVertex priority, int zone) { if (coordinates == null) { throw new ArgumentNullException(); } if (id == 0) { throw new ArgumentException(); } this.Id = id; this.Coordinates = coordinates; this.Priority = priority; this.Zone = zone; this.Zone0 = null; }
public abstract double Distance(PointCoordinates point2);
public override double Distance(PointCoordinates point2) { return Math.Sqrt(Math.Pow(X - point2.X, 2) + Math.Pow(Y - point2.Y, 2)); }
public static double Distance(PointCoordinates point1, PointCoordinates point2) { return Math.Sqrt(Math.Pow(point1.X - point2.X, 2) + Math.Pow(point1.Y - point2.Y, 2)); }
public readonly PointCoordinates[] Track; // Координаты отображения дуги public ArcInDateBase(int id, TimeSpan time, int distance, PointCoordinates[] track) { if (time == null || track == null) { throw new ArgumentNullException(); } if (track.Length < 2) { throw new ArgumentException(); } this.Distance = distance; this.Id = id; this.Time = time; this.Track = track; }
public int GetNearId(PointCoordinates coordinates) // Возвращает номер ближайшей вершины к точке с координатами coordinates. { throw new Exception("The method or operation is not implemented."); }