greatGathering Class Reference

#include <greatGathering.h>

Inheritance diagram for greatGathering:

MovementGenerator

List of all members.


Detailed Description

greatGathering class

Simulates many nodes gathering at one spot.

Public Member Functions

 greatGathering (double areaDimension, double speed, NeighborMap *Neighbors, GlobalCoordinator *coordinator)
virtual ~greatGathering ()
virtual void move ()
 Defined in subclasses only.

Protected Attributes

GlobalCoordinatorcoordinator


Constructor & Destructor Documentation

greatGathering::greatGathering ( double  areaDimension,
double  speed,
NeighborMap Neighbors,
GlobalCoordinator coordinator 
)

00027                :MovementGenerator(areaDimension, speed, Neighbors)
00028 {
00029     // get access to the repository
00030     this->coordinator = coordinator;
00031 
00032     if(coordinator->getPeerCount() == 0) {
00033         target.x = uniform(areaDimension / 3, 2 * areaDimension / 3);
00034         target.y = uniform(areaDimension / 3, 2 * areaDimension / 3);
00035         coordinator->increasePositionSize();
00036         coordinator->setPosition(0, target);
00037         coordinator->increasePeerCount();
00038     }
00039     else
00040         target = coordinator->getPosition(0);
00041 }

virtual greatGathering::~greatGathering (  )  [inline, virtual]

00041 {}


Member Function Documentation

void greatGathering::move (  )  [virtual]

Defined in subclasses only.

Implements MovementGenerator.

00044 {
00045     flock();
00046     position += direction * speed;
00047     testBounds();
00048 }


Member Data Documentation

GlobalCoordinator* greatGathering::coordinator [protected]


The documentation for this class was generated from the following files:
Generated on Thu Apr 17 13:19:29 2008 for ITM OverSim by  doxygen 1.5.3