Example #1
0
 public void AddLink(Router router, int weight)
 {
     neighbors.Add(router);
     router.AddNeighbor(this);
     network.addEdge(router.GetRouterId());
     network.setLink(id, router.GetRouterId(), weight);
     ReceivePacket(GeneratePacket(router));
 }
Example #2
0
 public Router(string id)
 {
     this.id   = id;
     neighbors = new List <Router>();
     packets   = new List <int>();
     network   = new NetworkGraph(15); //kiek routeriu norim
     network.addEdge(id);
     connections = new Dictionary <string, string>();
     connections.Add(id, id);
 }