|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article

Introduction
Ants first evolved around 120 million years ago, take form in over 11,400 different species and are considered one of the most successful insects due to their highly organised colonies, sometimes consisting of millions of ants.
One particular notability of ants is their ability to create "ant streets". Long, bi-directional lanes of single file pathways in which they navigate landscapes in order to reach a destination in optimal time. These ever-changing networks are made possible by the use of pheromones which guide them using a shortest path mechanism. This technique allows an adaptive routing system which is updated should a more optimal path be found or an obstruction placed across an existing pathway.
Computer scientists began researching the behaviour of ants in the early 1990's to discover new routing algorithms. The result of these studies is Ant Colony Optimisation (ACO) and in the case of well implemented ACO techniques, optimal performance is comparative to existing top-performing routing algorithms.
This article details how ACO can be used to dynamically route traffic efficiently. An efficient routing algorithm will minimise the number of nodes that a call will need to connect to in order to be completed thus; minimising network load and increasing reliability. An implementation of ANTNet based on Marco Dorigo & Thomas stützle has been designed and through this a number of visually aided test were produced to compare the genetic algorithm to a non-generic algorithm. The report will final conclude with a summary of how the algorithm perform and how it could be further optimised.
Background
Electronic communication networks can be categorised as either circuit-switched or packet-switched. Circuit-switched networks rely on a dedicated connection from source to destination which is made once at start-up and remains constant until the tear-down of the connection. An example of a circuit switched network would be British Telecoms telephone network. Packet-switched networks work quite differently however and all data to be transmitted is divided into segments and sent as data-packet. Data-packets can arrive out of order in a packets-switched network with a variety of paths taken through different nodes in order to get to their destination. The internet and office local area networks are both good examples of packet-switched networks. A number of techniques can be employed to optimise the flow of traffic around a network. Such techniques include flow and congestion control where nodes action packet acknowledgements from destination nodes to either ramp-up or decrease packet transmission speed. The area of interest in this report concentrates on the idea of network routing and routing tables. These tables hold information used by a routing algorithm to make a local forwarding decision for the packet on the next node it will visit in order to reach its final destination.
One of the issues with network routing (especially in very large networks such as the internet) is adaptability. Not only can traffic be unpredictably high but the structure of a network can change as old nodes are removed and new nodes added. This perhaps makes it almost impossible to find a combination of constant parameters to route a network optimally.
Routing algorithms
Packet-switched networks dynamically guide packets to their destination via routing tables stored in a link state and are selected via a link state algorithm.
The Link state algorithm works by giving every node in the network a connectivity graph of the network. This graph depicts which nodes are directly connected. Values are stored for connected nodes in map which represent the shortest path to other nodes. One such link state algorithm used in network routing is Dijkstras algorithm. When a path between two nodes is found, its weight is updated in the table. Should a shorter path be found the new optimal weight will be updated to the table replacing the old value.
The algorithm allows traffic to be routed around the network whilst connecting to the least number nodes as possible. The system works but doesn't take into account influx of traffic and load balancing.
Introducing ANTNet
By replacing Dijkstras algorithm with a generic algorithm, paths taken by calls could be scored by how short of a path they took, that way if they were queued on a busy network they would perform badly. Consequently other paths would score relative and be chosen. This would work in real time and allow the routing system to adapt as packets are transmitted ANTNet uses virtual pheromone tables much like when an ant follows a path dropping pheromones to re-enforce it. The quicker the ants move down a path the more throughput of ants thus; a greater concentration of pheromones. In the same way pheromone tables in ANTNet allow fast routes to score a higher chance of being selected whilst the less optimal route scores a low chance of being selected.
The idea behind ANTNet is when a call is placed an Ant will traverse across the network using a link-state deterministic algorithm. Every node holds a pheromone table for all other nodes of the network. Each pheromone table holds a list of table entries containing all the connected nodes of the current node.
The algorithm
To begin with, each possible path has an even likelihood of being chosen. An ant is placed on a network of 4 nodes with the source node of 1 and destination node 2. A chance mechanism is invoked and a path is chosen.

Figure 3.1 - The network graph |
Next Node |
% chance |
2 |
33.33333% |
3 |
33.33333% |
4 |
33.33333% |
Table 3.1 - Pheromone table for node 1 |
In this case node 2 has been selected [figure 3.2] and the ant arrives at its source destination.
The ant then moves and updates the pheromone tables for the visited nodes with higher (and more mathematically biased) value. This would be calculated for figure 3.2 and table 3.2 in the following way:
- Node 2 was the final destination
- It took 1 hop to get to its destination
- Divide 1 (hop) by 100 : 100%
- Add 100 to the probability value of node 2 (currently 33.3333) : 133.3333
- Add the values of the other nodes to 133.3333 (133.3333+ 33.3333 + 33.3333) : 200 (approximately)
- Calculate the ratio : ratio = 100/200 0.5
- Set the probability of the node to its current value multiplied by the ratio
- Node 2: 133.3333 * ratio (0.5) = 66.6666%
- Node 3: 33.3333 * ratio (0.5) = 16.6666%
- Node 4: 33.3333 * ratio (0.5) = 16.6666%
- Node 2 (66.6666%) + Node 3 (16.6666%) + Node 4 (16.6666%) = 99.9999%
The system isn't 100% accurate as the total will never add up to exactly 100% but it will be close enough to allow accuracy within the level required.
The following diagram depicts how the path and pheromone table after the update has taken place.

Figure 3.2 |
Next Node |
% chance |
2 |
66.6666% |
3 |
16.6666% |
4 |
16.6666% |
Table 3.2 |
The program
For the purpose of this program a bi-directional, un-weighted topological network consisting of 30 nodes has been created and closely resembles the British Synchronous Digital Hierarchy (SDH) network. After a basic number of parameters have been set the simulation is run. Firstly all pheromone tables are defaulted to equal weights and then calls are generated and placed on the network. Initially the routes chosen are random. If a call cannot connect to a node it is forced to wait and the wait counter is enumerated to reflect the quantum (in timer ticks). Once a node has reached its destination node it will work its way backwards altering the local nodes pheromone table as it traverses. The shorter the route taken the greater increase in probability given to its table entry in the pheromone table. This happens repeatedly until the weight of the fastest node is shifted such that slower routes have a very low probability of being chosen.
NOTE: in order to compile and run the program you will need to download dotnetcharting from dotnetcharting.com
Program features
- ANTNet On/Off – Switches the algorithm on and off
- Simulation Speed – 1 tick p/s – 1,000 tick p/s (or as near speed as the system can run)
- Total calls to make – Number of completed calls before simulation termination
- Maximum concurrent calls – number of calls allowed at the same time
- Node capacity – The number of calls a node can route at once
- Call duration – The length (in ticks) of a call
- Reduce I/O – bypasses the network visualisation to increase simulation speed
- Return on connection – returns the node immediately to source after connection
- Real-time network load visualisation – view Node ID, capacity and routing state (blue = OFF)
- Graphing facility with labelling and simulation overlay
- Render Pheromone Tables to HTML
Classes
- MainForm – The GUI for the application
- DrawPanel – The real-time network visualisation custom control
- Global – Contains static variables that are accesses by the application
- Node – Represents a Node and holds an array of PheromoneTable objects for routing
- Call – Represents a call on the network and hold a source and destination node
- Simulation – Represents a completed simulation and is used for creating graphs
- PheromoneTable - A routing table for a Node
The network contains 30 Nodes and each Node contains an array of PheromoneTable objects, one for every other Node in the network (29). Every PheromoneTable contains an array of TableEntries, one for each Node connected to the current Node.
The following diagram represents the relationships between classes in the program.
Update the pheromone table
public int ProbablePath(ArrayList VisitedNodes)
{
Random r = new Random(Global.Seed);
double val=0;
double count = 0;
double Lastcount = -1;
ArrayList tempTEVector=new ArrayList();
for(int i=0;i<tableEntry.Length;i++)
{
bool v=false;
for(int j=0;j<VisitedNodes.Count;j++)
{
if(tableEntry[i].NodeID==(int)VisitedNodes[j])
v=true;
}
if(!v)
{
Node n = Global.Nodes[tableEntry[i].NodeID];
if(!n.FullCapacity)
{
tempTEVector.Add(tableEntry[i]);
}
}
}
if(tempTEVector.Count==0)
{
for(int i=0;i<tableEntry.Length;i++)
tempTEVector.Add(tableEntry[i]);
}
for(int i=0;i<tempTEVector.Count;i++)
val+= ((TableEntry)tempTEVector[i]).Probablilty;
val = r.NextDouble()*val;
for(int i=0;i<tempTEVector.Count;i++)
{
count += ((TableEntry)tempTEVector[i]).Probablilty;
if(val>Lastcount && val < count)
return ((TableEntry)tempTEVector[i]).NodeID;
Lastcount=count;
}
return -1;
}
Return the next node via the pheromone table
public void UpdateProbabilities(double newVal, int EntryTableNodeID)
{
TableEntry t;
double total=0;
for(int j=0;j<tableEntry.Length;j++)
{
t = tableEntry[j];
total += t.Probablilty;
if(EntryTableNodeID==t.NodeID)
{
total += newVal;
t = tableEntry[j];
t.Probablilty += newVal;
}
}
double ratio = 100/total;
for(int j=0;j<tableEntry.Length;j++)
{
tableEntry[j].Probablilty *= ratio;
}
}
public PheromoneTable(Node n, int[] conns)
{
this.NodeID = n.ID;
this.tableEntry = new TableEntry[conns.Length];
for(int i=0;i<conns.Length;i++)
tableEntry[i] = new TableEntry(conns[i]);
for(int i=0;i<conns.Length;i++)
tableEntry[i].Probablilty = (100 / (double)conns.Length);
}
}
Simulation results
The following tests will illustrated how the ANTNET algorithm effects the routing of traffic. These tests will show effectiveness of the algorithm against the system running without ANTNET. Since it is possible to switch nodes on and off, a number of test comparisons will be done to show how ANTNET can improve the routing of a network when paths are no longer valid and new routes have to be chosen.
These tests have been run with the following parameters
- ANTNet On
- Simulation Speed –1,000 tick p/s
- Total calls to make – 5000
- Maximum concurrent calls – 60
- Node capacity – 35
- Call duration – 170 The length (in ticks) of a call
- Reduce I/O – bypasses the network visualisation to increase simulation speed
- Return on connection – returns the node immediately to source after connection
5.1 ANTNet VS non- ANTNet
The first test contains two simulations.
- Simulation 1 ( Orange ) – ANTNet algorithm OFF
- Simulation 2 ( Blue) – ANTNet ON
From this simulation it is clear that even by the first 500 calls completed, ANTNet has reduced the average number of hops by approximately 1.5 nodes. This is made more apparent by the end of the simulation where the best paths are made more biased as a choice and are re-enforced as the optimal route, resulting in ANTnet improving network performance by almost 3.5 hops

Figure 5.1 – Non-adaptive algorithm ( orange) VS ANTNet algorithm ( blue)
To view the algorithm from a different perspective the following graph depicts the system running with the ANTNet algorithm off and then activated on the 2,000 th call. This can be identified by a label and follows with a decline of average hops by almost 2.

Figure 5.2 – ANTNet activated after the 2000th call
5.2 Loop elimination
Before an Ant returns back to its source node, an optimisation technique of loop elimination can be invoked. The problem with loops is that they can receive several times the amount of pheromone than they should, leading to the problem of self re-enforcing loops.

Figure 5.3 – Loop removal ( Blue) VS non-loop removal ( Orange )
Figure 5.3 shows two simulations:
- Simulation 1 ( Orange ) – Loop elimination OFF
- Simulation 2 ( Blue) – Loop elimination ON
From this test, loop elimination has reduced the average number of hops by 1 node with a much more stable adaptation. This would mean that when alternative paths must be chosen, the loop elimination algorithm responds much faster that the regular implementation.
Note: Both lines show the actual number of nodes traversed and not the number after loop removal.
5.3 Adaptivity
It is important to simulate how the network adapts when nodes are removed from the network. Static routing tables may hold the shortest path but they don't necessarily take into account network traffic and nodes that are offline. Three simulations have been run on the program to display how the system adapts compared to a non adaptive algorithm.

Figure 5.4 – Adaptive vs non-adaptive algorithm
Simulation 1 ( orange)
This is a normal run of the simulator to create optimised Pheromone tables for the next two simulations.
Simulation 2 ( blue)
Adaptive algorithm switched OFF.
Nodes 14,15 and 17 are switched off as these are the main Northern access hubs into London so traffic needs to be diverted to the west of England . Since the network is non adaptive, the pheromone tables are biased towards nodes that are have been taken offline and subsequently being continuously redirected and taking longer journeys every time. This increase is displayed in figure 6.4 by the blue line.
Simulation 3 ( green)
Adaptive algorithm switched ON.
Nodes 14,15 and 17 are still switched off but since the network is now set to adaptive, the pheromone tables are readjusted and the system learns alternative routes. This can be seen in figure 6.4 by the green line.
Recommendations
If anyone has any questions, bugs or suggestions then please make a comment.
References
[1] Appleby, S., & Steward, S. (1994). Mobile software agents for control in telecommunications Networks.
In BT Technology Journal, Vol. 12, No.2.
[2] AntNet: A Mobile Agents Approach to Adaptive Routing
Gianni Di Caro and Marco Dorigo
[3]Ant-based load balancing in telecommunications networks
Ruud Schoonderwoerd1,2, Owen Holland3, Janet Bruten1 and Leon Rothkrantz
[4] AntNet: A Mobile Agents Approach to Adaptive Routing
Gianni Di Caro and Marco Dorigo
[5] Data Networks
Bertsekas, D., & Gallager, R. (1992).
| You must Sign In to use this message board. |
|
| | Msgs 1 to 25 of 87 (Total in Forum: 87) (Refresh) | FirstPrevNext |
|
 |
|
|
 |
|
|
hi iwillsay thank you for your project i cantnt speak english im from iran i love you i say thank you
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Well I love you too man!
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hi sir,this is rajasekhar from india.. my doubt is, can u tell me why dijkstra's algorithm is used when we run the system i.e simmulation after giving the initial parameters when ANT net mode is OFF.....?
what is the meaning of reduced i/o option and tell me the difference between enable and disable...?
In which areas this algorithm will be used in further?
Can we use this algorithm in our college LAN networking? If possible guide me how can i implement that?
How can i support this when compared this algorithm with others like swarm intelligence , ohter routing algorithms?
Most importantly......please send me actual algorithms of dijkstra's and ANT Net with small examples....Dont ignore this..Algorithms must keep in this article....... my mail id is .. rajasekhar.juvvina@gmail.com
modified on Monday, May 5, 2008 11:13 PM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thank you for the nice article  I read it and tried to understand the code by tracing it through some breakpoints in the debugger. Doing that I have found a statement that confused me a little bit.
MainForm.cs : line 255 : Ticker_Tick()
// snipp ... if(c.NewValue==-1) { // 1. calculate new value double total = Global.CallDuration; //dont use self for calc double vnodes = c.VisitedNodes.Count-1; c.NewValue = ((1/(vnodes/total))/total)*100; } // snipp ...
Ticker_Tick() method: iterating over already generated calls the call has the backward ant direction its the first step of having backward direction then the NewValue property of the call has to be calculated (was -1 before)
Now the question: why do you use such a comlex term and not simply NewValue = 1/vnodes * 100 the result would be the same
Best Regards Rudi
PS: Sorry for my Englisch, im not a native speaker
-- modified at 5:38 Friday 20th April, 2007
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
haha.. sure, ok
This was a university assignment for my degree, I built it in my spare time in a week. The development time was basically prototyping algorithms as I went..
The answer to your question is, I never went back and optmised.. its merly a proof on concept....
I dont think its going to make the traffic run any slower however..lol and the algorithm works accuratly.. but yes, not as optimal optimal as it could be ..
Cheers
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I loved the article first of all. My background is in math and topology is one of my favorite subjects.
Here is what I am wondering:
So once the certain nodes are turned off the system learns that they are not working, and decreases their pheramone rating. Eventually each incapacitated node's rating would go to 0.
Once the system has suffciently learned that these nodes are no longer viable, how quickly does the system respond when the nodes come back online?
Great ideas, Justus
www.tmrmusic.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Justus,
This is a very good question!
For this particular implementation the system works on the laws of averages. Thus; if the system has been working on harvested data over a period of hours then the time it takes for this to be reflected would probably be hours too! Obviously if the system was running for days or months at a time without change then it would not be very practical because the change in the network would take this long before the bias is reflected in the routing tables.
So, this is where a technique called pheromone evaporation comes in... After a period of time that the pheromone was layed down, it evaporates and the average is recalulated. This means that on the last x minutes of hops was calculated in the genetic algorithm. The less time it takes to evaporate the faster the network will adapt.. However, increasing this number to a low degree would mean that the algorithm would not have sufficiant data to compare routes and optimise for the best. So there is a trade off between fasted known routes and network adaptivity.
Does this answer your question?
Lawrence
-- modified at 11:36 Thursday 19th April, 2007
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Very interesting.
My next thought is:
There are scout ants that probe (randomly?) for new paths to food, etc. Can a network be set up with "scout packets" in this same way to try currently unused routes?
-Justus
www.tmrmusic.com
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Well they could but then it would defeat the object of the improving the routing algorithm.
Extra packets means extra load on the network...
The ants do this anyway so it best represents the model of the network.. in its true form..
Make Sense?
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
From Ms.Sai Prasanna, Dear Sir,
Some more doubts about the differences between AntNet ON and OFF stages
1.In case of AntNet ON, update of Pheromone Values takes place. How about Ant Net OFF? Will there be any out put of Pheromone Values? What will be shortest path in this case? Direct from source to destination?
2.The yard stick for the best route at the end of Ant Net ON run is defined by less number of Average Hops (If I understood the method correctly!). But will there be any shortest route defined in the process and if so how to know which nodes it has taken along the shortest path to reach the destination?
The more I go through your work, the more I am getting doubts and bothering you. Sorry for that.
K.SAI PRASANNA
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
1.In case of AntNet ON, update of Pheromone Values takes place. How about Ant Net OFF? Will there be any out put of Pheromone Values? What will be shortest path in this case? Direct from source to destination?
When AntNet of switched off none of the pheromone values are read or written
Im sorry, I dont understand your second question! could you elaborate
Lawrence
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Dear Sir,
Thank you for the answer for the first Question.
By second Question, I mean:
For a successful call, is it possible to know through which nodes(out of the 30 nodes topology), it has actually routed to reach from its source to the destination. Regards
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Sir,
In general, ABC is used for circuit switch networks and Antnet for packet switch networks.You have applied the method for telephone network, which is basically a circuit switch network.
I wish to know more about how the concept of Antnet was used in telephone network problem and in particular the role of backward ant principle in this method.Is your method a combination of ABC and AntNet?
Regards
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
In general, ABC is used for circuit switch networks and Antnet for packet switch networks.You have applied the method for telephone network, which is basically a circuit switch network.
For the purpose of this program a bi-directional, un-weighted topological network consisting of 30 nodes has been created and closely resembles the British Synchronous Digital Hierarchy (SDH) network
I was just using this as an example.
Maybe British Telecoms 21st Century VOIP network would better represent the packet switched telephony network I have described.
I guess you could call it a hybrid of the two. I havent followed specific rules from Doringo. I really designed my own mathmatical implementation using his concept of pheromone tables.
Hope this helps!
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi!
Can you please let me know: You have used this program for SDH net work with 30 nodes.
Can I make this program work for a more simple topology and if so what changes have to be made in the code?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Sure you can!
I wrote this document for a Masters student I am helping out but a number of people have asked this quesstion so here is some help!
1 Change the network edge
There are three classes involved in this Global.cs , drawpanelcs and MainForm.cs
The steps are quite simple but you must be exact..
A. Go to the Global.cs class and change the NumberOfNodes variable to the desired value (It is currently set to 30. IE)
public const int NumberOfNodes = 30;
B. You must then go to DrawPanel.cs and there are two arrays you are concerned with, these are Cords and Connections. The cords (coordinates) array contains an X,Y point on the screen for the nodes to be drawn. So, if the first item in the array is 100,200 then the first node will be drawn on the scrren at 100 pixels from the left and 200 pixels from the top.
This is what the 30 nodes are currently set to: (the first node is drawn at 32 pixels from the top and 22 pixels on the left.. (I believe it is this way around anyway)) // the drawing coordinates for each node public static Point[] coords = new Point[] { new Point(32,22), new Point(95,18), new Point(192,112), new Point(210,112), new Point(125,268), new Point(152,259), new Point(192,226), new Point(225,214), new Point(156,350), new Point(223,311), new Point(174,357), new Point(224,345), new Point(281,349), new Point(125,456), new Point(206,423), new Point(249,403), new Point(272,411), new Point(308,391), new Point(380,395), new Point(281,439), new Point(294,443), new Point(308,447), new Point(303,460), new Point(295,468), new Point(281,464), new Point(227,452), new Point(317,488), new Point(259,480), new Point(277,451), new Point(179,501), };
So that’s the first array!
The second array contains all the connections with each entry in the array containing another array of node numbers.. So currently the code is the following:
private static int[][] Connections = new int[][] { new int[]{1,2,4}, new int[]{0,2,3}, new int[]{0,1,3,4,6}, new int[]{1,2,7}, new int[]{0,2,5,8}, new int[]{4,6,10}, new int[]{2,7,9,5}, new int[]{3,6,9,12}, new int[]{4,9,10,13}, new int[]{6,7,8,11,12}, new int[]{5,8,11,15,28,14,13}, new int[]{9,12,15,10}, new int[]{7,9,11,17}, new int[]{8,10,14,25,29}, new int[]{10,16,25,13}, new int[]{10,11,17,16}, new int[]{14,15,19}, new int[]{12,15,20,18}, new int[]{17,21}, new int[]{16,20}, new int[]{19,17,21}, new int[]{20,18,22}, new int[]{21,23,26}, new int[]{22,27}, new int[]{28,23,29}, new int[]{13,14,28,27,29}, new int[]{22,27}, new int[]{26,23,25}, new int[]{10,25,24}, new int[]{13,25,24} };
So, The first item in the array is new int[]{1,2,4}, (and remember arrays start from zero) So Node zero has a connection to Node 1, Node 2 and Node 4.
The second node value is new int[]{0,2,3}, (And this is index 1 in the array as arrays start from zero) so node 1 is connected to node 0, Node 2 and Node 3.
So this array not only sets up what how the simulator will actually work and route traffic but it will also draw all the lines to each node for you.
Finally, in the Mainform.cs there is a line of code: Global.Calls.Add(new Call(r1.Next(0,29), r2.Next(0,29)));
Change this value (0,29) to (0, number of nodes – 1) .. I should have references this from the global class.. you could do that with the following code Global.Calls.Add(new Call(r1.Next(0, NumberOfNodes -1), r2.Next(0, NumberOfNodes-1)));
I would suggest that you start small.. maybe 5 nodes or less and add a few nodes at a time or you may get problems if you have a large number and some of your number are out.. But just check the screen and remember that if they have a line drawn between them then they are connected.. otherwise they are not!
Next Turning off Nodes….
It must be notes that although you can shut down a node so it doesn’t route traffic it can still take connetions if the node is the final destination node. This is to make the simulation fair or if you shut down 50 of the nodes then it will look like you have 50% failiure..
So.. what I would do is go to the mainform.cs file and go to the method labelled Ticker_Tick IE // this method is called on every tick of the timer private void Ticker_Tick(object sender, System.EventArgs e)
This gets fired every second..
Then, the following value determines how many calls have been made so far Global.TotalCallsMade
Then.. inside the loop you could switch off a node that are stored in the global class…. IE
Global.Nodes[0].DontRouteTraffic = true;
This would switch off the first node in the array
So you could switch off specific nodes by doing this
Global.Nodes[6].DontRouteTraffic = true; Global.Nodes[3].DontRouteTraffic = true; Global.Nodes[7].DontRouteTraffic = true; Global.Nodes[4].DontRouteTraffic = true; Global.Nodes[12].DontRouteTraffic = true;
Or just deactivate half of them by looping For(int i=0;i Global.Nodes[i].DontRouteTraffic = true;
For the graphing, Im not sure if the label will show if you do this programmatically.. If It doesn’t you can add an event the simulation with the following code
sim.AnnoText[sim.AnnoText.Count-1] = "Node "+lbNodes.SelectedIndex.ToString()+" Routing Off";
As it happens you can add any message to the sim and it will appear as text, rendered on your graph at the point in the simulation where it was added: ID
sim.AnnoText[sim.AnnoText.Count-1] = “Hello World!”;
So… whenever you run a test.. I don’t think it would be too concerned with how the change the ssim settings.. as long as you make the test fair.. So comparing algorithms is all good as long as you shut down the same nodes at the same time as each simulations… remember, you can find at what point the simulation is at by looking at the Global.TotalCallsMade Variable…
Within the twentieth century, an ultraintelligent machine will be built and that it will be the last invention that man need make.
I.J. Good
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Dear Professor Lawrence Botley,
I am extremely grateful for the elaborate reply for my doubt reg. appication of your code to a smaller topology.
May I ask you one more question ?
I want to use your code for smaller topologies and make use of the results for presentation in a Seminar. I should no doubt use your reference and also should not present the code. Can I go ahead?
Kindly confirm
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
| | |