driver
Class bordercast

java.lang.Object
  extended by driver.bordercast

public class bordercast
extends java.lang.Object

Bordercast evaluation. Derived from CBR.java

Version:
$Id: bordercast.java,v 1.24 2004/11/08 19:59:38 barr Exp $
Author:
Rimon Barr

Nested Class Summary
private static class bordercast.CommandLineOptions
          Simulation parameters with default values.
 
Field Summary
private static java.lang.reflect.Method method_addNode
          addNode method stub.
private static int PORT
          Default port number to send and receive packets.
 
Constructor Summary
bordercast()
           
 
Method Summary
static void addNode(bordercast.CommandLineOptions opts, int i, java.util.Vector routers, RouteZrp.ZrpStats 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(bordercast.CommandLineOptions opts, java.util.Vector routers, RouteZrp.ZrpStats stats)
          Constructs field and nodes with given command-line options, establishes client/server pairs and starts them.
static java.lang.reflect.Method findUniqueMethod(java.lang.Class c, java.lang.String name)
          Lookup method in a class by name.
static void main(java.lang.String[] args)
          Starts the bordercast simulation.
private static bordercast.CommandLineOptions parseCommandLineOptions(java.lang.String[] args)
          Parses command-line arguments.
static void showStats(java.util.Vector routers, RouteZrp.ZrpStats stats)
          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

method_addNode

private static java.lang.reflect.Method method_addNode
addNode method stub.

Constructor Detail

bordercast

public bordercast()
Method Detail

showUsage

private static void showUsage()
Prints a usage statement.


parseCommandLineOptions

private static bordercast.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.

findUniqueMethod

public static java.lang.reflect.Method findUniqueMethod(java.lang.Class c,
                                                        java.lang.String name)
                                                 throws java.lang.NoSuchMethodException
Lookup method in a class by name.

Parameters:
c - class to scan
name - method name
Returns:
method, if found and unique
Throws:
java.lang.NoSuchMethodException - if method not found or not unique

addNode

public static void addNode(bordercast.CommandLineOptions opts,
                           int i,
                           java.util.Vector routers,
                           RouteZrp.ZrpStats 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(bordercast.CommandLineOptions opts,
                               java.util.Vector routers,
                               RouteZrp.ZrpStats 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,
                             RouteZrp.ZrpStats stats)
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)
Starts the bordercast simulation.

Parameters:
args - command-line arguments that may determine the parameters of the simulation