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.

2.3 Parameters and packetsParameter is an object used to store any <strong>in</strong><strong>for</strong>mation about a component that needs to bedisplayed on the screen, logged to disk, or saved <strong>in</strong> a network file. The <strong>in</strong>stance variables ofa Parameter object are as follows:Private Str<strong>in</strong>g name;private <strong>in</strong>t displayType;private <strong>in</strong>t flags;private double scale;private <strong>in</strong>t logType;private Object value;The actual value of a parameter object is stored <strong>in</strong> the value variable. Because it is Objecttype, so it can be an Integer, Double, a L<strong>in</strong>kedList, a Str<strong>in</strong>g or someth<strong>in</strong>g else depend<strong>in</strong>g onwhat k<strong>in</strong>d of type value an Component object want to store <strong>in</strong> that parameter. And flagsdescribe how to save and/or display the parameter. It will be used when the GUI was addedto the CuRS. A component object can have as many parameters as needed. They are stored<strong>in</strong> the L<strong>in</strong>kedList named params which is def<strong>in</strong>ed <strong>in</strong> the AbstractComponent class.The target system is a message pass<strong>in</strong>g system. Messages are passed <strong>in</strong> the packets. Thereare two ma<strong>in</strong> types packets <strong>in</strong> the <strong>simulator</strong>: TR_PACKET is the application/transport partof the packet. ROUTE_PACKET is the rout<strong>in</strong>g part of the packet. Rout<strong>in</strong>g packet hashigher priority than the data packet.2.4 Interface design and implementationUser InterfaceCurrently CuRS just provides command l<strong>in</strong>e options and files as user <strong>in</strong>terface. Thegraphical user <strong>in</strong>terface will be added <strong>in</strong> the next stage of this project. The command l<strong>in</strong>eoptions <strong>in</strong>clude the specification of the length of the simulation run, the seed <strong>for</strong> randomnumber generator, the name of the network file, the name of the record file, the length ofthe startup <strong>in</strong>terval, and the per<strong>for</strong>mance monitor update period. The user manual isprovided <strong>in</strong> section 7 of this report.FilesCuRS works with four ASC|| files, they are the network file, the snap file, the record fileand the log file.A network file <strong>in</strong>cludes a description of the network to be simulated. It consists of the threedist<strong>in</strong>ct parts. The first part is a list of all component objects with their <strong>in</strong>put parametervalues; the second part <strong>in</strong>dicates the <strong>in</strong>terconnection of the objects. The third part lists thepeer components. The networkfile is created manually. If the GUI is added <strong>in</strong> the future,then the user can create network us<strong>in</strong>g GUI. The network files <strong>in</strong>clude all <strong>in</strong><strong>for</strong>mationneeded to carry out a simulation.A snap file actually is a networkfile with additional <strong>in</strong><strong>for</strong>mation such like the values of thecurrent output parameters, the seed <strong>for</strong> the random number generator, the time of thesnapshot, and the flags that <strong>in</strong>dicates the parameters logged.CuRS provides record and play options which is specified from the command l<strong>in</strong>e. Withthose options, the record-class events are read and scheduled from the record file. So wecan simulate different rout<strong>in</strong>g algorithms subject to the same sequence of the event andoccurrence times <strong>for</strong> a special set of events.

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

Saved successfully!

Ooh no, something went wrong!