17.07.2015 Views

Implement a simulator, in Java, for evaluating AntNet routing protocol

Implement a simulator, in Java, for evaluating AntNet routing protocol

Implement a simulator, in Java, for evaluating AntNet routing protocol

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The components are used <strong>for</strong> model<strong>in</strong>g the target system and certa<strong>in</strong> simulationfunctions. Each component is object which has its states and behaviors. In MaRS everycomponent has its action rout<strong>in</strong>e associated with different events specified <strong>in</strong> the MaRSversion 1.0. When an event occurs, each component's action rout<strong>in</strong>e is <strong>in</strong>voked <strong>for</strong> thatevent. Actually it uses function po<strong>in</strong>t <strong>in</strong> C to achieve this. While there is not function po<strong>in</strong>tavailable In <strong>Java</strong>. So <strong>in</strong> CuRS I use Observer/Observable Pattern to achieve this. Figure 1,2, 3 shows the relationship of components Diagrams. Component was designed asInterface to represent all components <strong>in</strong> the target system. Such as Node, L<strong>in</strong>k,L<strong>in</strong>kCostFunction component, Rout<strong>in</strong>g component, Workload component (FTP) andper<strong>for</strong>mance monitor. Component Interface extends four k<strong>in</strong>ds of EventListener Interfacewhich has different methods <strong>for</strong> different types events and also has association with one offour classes’ event. Every concrete component implements its associated methods tooverride the methods def<strong>in</strong>ed <strong>in</strong> the AbstractComponent. Each component is an Object.The target system consists of a set of objects. By <strong>in</strong>terconnect<strong>in</strong>g multiple objects ofvarious types of components, a target system of arbitrary topology, rout<strong>in</strong>g <strong>protocol</strong>, andworkload can be obta<strong>in</strong>ed.The components schedule events <strong>for</strong> each other. Also, a component can schedule anevent <strong>for</strong> itself. The time of this event to happen depends on the l<strong>in</strong>k propagation delay.Each component has methods to update system state and may schedule other eventsdepend<strong>in</strong>g on the type of the event received by the component.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!