example.hot
Class InetInitializer

java.lang.Object
  extended by example.hot.InetInitializer
All Implemented Interfaces:
Control

public class InetInitializer
extends java.lang.Object
implements Control

This initialization class collects the simulation parameters from the config file and generates uniformly random 2D-coordinates for each node. The coordinates are distributed on a unit (1.0) square.

The first node in the Network is considered as the root node and its coordinate is set to the center of the square.


Parameter Summary
protocol
          The protocol to operate on.
 
Constructor Summary
InetInitializer(java.lang.String prefix)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Initialize the node coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

protocol

The protocol to operate on.

Constructor Detail

InetInitializer

public InetInitializer(java.lang.String prefix)
Standard constructor that reads the configuration parameters. Invoked by the simulation engine.

Parameters:
prefix - the configuration prefix for this class.
Method Detail

execute

public boolean execute()
Initialize the node coordinates. The first node in the Network is the root node by default and it is located in the middle (the center of the square) of the surface area.

Specified by:
execute in interface Control
Returns:
true if the simulation has to be stopped, false otherwise.