driver
Class aodvsim

java.lang.Object
  extended by driver.aodvsim

public class aodvsim
extends java.lang.Object

AODV simulation. Derived from bordercast

Author:
Clifton

Nested Class Summary
private static class aodvsim.CommandLineOptions
          Simulation parameters with default values.
 
Field Summary
private static int PORT
          Default port number to send and receive packets.
 
Constructor Summary
aodvsim()
           
 
Method Summary
static void addNode(aodvsim.CommandLineOptions opts, int i, java.util.Vector routers, RouteAodv.AodvStats stats, Field field, Placement place, RadioInfo.RadioInfoShared radioInfo, Mapper protMap, PacketLoss inLoss, PacketLoss outLoss)
          Add node to the field and start it.
private static void buildField(aodvsim.CommandLineOptions opts, java.util.Vector routers, RouteAodv.AodvStats stats)
          Constructs field and nodes with given command-line options, establishes client/server pairs and starts them.
static void main(java.lang.String[] args)
          Main entry point.
private static aodvsim.CommandLineOptions parseCommandLineOptions(java.lang.String[] args)
          Parses command-line arguments.
static void showStats(java.util.Vector routers, RouteAodv.AodvStats stats, aodvsim.CommandLineOptions opt, java.util.Date startTime)
          Display statistics at end of simulation.
private static void showUsage()
          Prints a usage statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT

private static final int PORT
Default port number to send and receive packets.

See Also:
Constant Field Values
Constructor Detail

aodvsim

public aodvsim()
Method Detail

showUsage

private static void showUsage()
Prints a usage statement.


parseCommandLineOptions

private static aodvsim.CommandLineOptions parseCommandLineOptions(java.lang.String[] args)
                                                           throws jargs.gnu.CmdLineParser.OptionException
Parses command-line arguments.

Parameters:
args - command-line arguments
Returns:
parsed command-line options
Throws:
CmdLineParser.OptionException - if the command-line arguments are not well-formed.

addNode

public static void addNode(aodvsim.CommandLineOptions opts,
                           int i,
                           java.util.Vector routers,
                           RouteAodv.AodvStats stats,
                           Field field,
                           Placement place,
                           RadioInfo.RadioInfoShared radioInfo,
                           Mapper protMap,
                           PacketLoss inLoss,
                           PacketLoss outLoss)
Add node to the field and start it.

Parameters:
opts - command-line options
i - node number, which also serves as its address
routers - list of zrp entities to be appended to
stats - statistics collector
field - simulation field
place - node placement model
radioInfo - shared radio information
protMap - registered protocol map
inLoss - packet incoming loss model
outLoss - packet outgoing loss model

buildField

private static void buildField(aodvsim.CommandLineOptions opts,
                               java.util.Vector routers,
                               RouteAodv.AodvStats stats)
Constructs field and nodes with given command-line options, establishes client/server pairs and starts them.

Parameters:
opts - command-line parameters
routers - vectors to place zrp objects into
stats - zrp statistics collection object

showStats

public static void showStats(java.util.Vector routers,
                             RouteAodv.AodvStats stats,
                             aodvsim.CommandLineOptions opt,
                             java.util.Date startTime)
Display statistics at end of simulation.

Parameters:
routers - vectors to place zrp objects into
stats - zrp statistics collection object

main

public static void main(java.lang.String[] args)
Main entry point.

Parameters:
args - command-line arguments