public Link(Node firstNode, Node secondNode, double bandWidth) { FirstNode = firstNode; SecondNode = secondNode; BandWidth = bandWidth; Length = Metric(firstNode.Coordinates,secondNode.Coordinates); }
public override void Add(Node node) { if (_Nodes.IsEmpty()) { _Nodes.Add(node); } else { _Links.Add(new Link(_Nodes.Last(),node, BandWidthFactory.GetBandWidth())); _Nodes.Add(node); } }
public abstract void Add(Node node);
private void AddLink(Node firstNode, Node secondNode) { _Links.Add(new Link(firstNode, secondNode, BandWidthFactory.GetBandWidth())); }
public override void Add(Node node) { _Nodes.ForEach(x => AddLink(x, node)); _Nodes.Add(node); }