Sim
Class UniformLocationGenerator

java.lang.Object
  extended by Sim.UniformLocationGenerator
All Implemented Interfaces:
LocationGenerator

public class UniformLocationGenerator
extends java.lang.Object
implements LocationGenerator

Generates a uniform square field of nodes within the center of the area. Nodes are seperated by half the transmission range. Not that smart of a generator, does not check if the uniform distribution is within the area, just attempts to center the nodes. Keep the width/height area larger than sqrt(nodes)*tx.


Constructor Summary
UniformLocationGenerator(java.lang.Integer totalNodes, java.lang.Double transmissionRange, java.lang.Integer area)
          Generates a new UniformLocation structure.
 
Method Summary
 Location getNext()
          Gets the next node location in the field thus far.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniformLocationGenerator

public UniformLocationGenerator(java.lang.Integer totalNodes,
                                java.lang.Double transmissionRange,
                                java.lang.Integer area)
Generates a new UniformLocation structure. Attempts to shape the field in a square pattern of nodes in the middle of the field.

Parameters:
totalNodes - total number of nodes in the simulation
transmissionRange - the range of each node
area - the area of the field
Method Detail

getNext

public Location getNext()
Gets the next node location in the field thus far.

Specified by:
getNext in interface LocationGenerator
Returns:
non-null generated Location