blob: 4889bdbebdfc8e81d0fea721b83f0dcfc36e1dee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
using System;
using System.Collections.Generic;
using Graph;
using Interfaces;
namespace TSP
{
using INode = INode<double>;
using IVertex = IVertex<Edge<double>, double>;
using Road = Edge<double>;
using Vertex = Vertex<Edge<double>, double>;
public partial class City : Vertex, IVertex, IComparable<INode>
{
public new double Key { get => this[Parent].Weight; }
public Coordinate Location { get; set; }
public City() { }
public City(int id) =>
Id = id;
public City(int id, List<Road> edges) : this(id) =>
Edges = edges;
public City(IVertex city) : this(city.Id, city.Edges) =>
Parent = city.Parent;
public City(IVertex city, Coordinate location) : this(city) =>
Location = location;
public City(City city) : this(city, city.Location) { }
}
}
|