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, CollisionList *CollisionRect)
virtual ~greatGathering ()
virtual void move ()
 Defined in subclasses only.


Constructor & Destructor Documentation

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

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

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

00038 {}


Member Function Documentation

void greatGathering::move (  )  [virtual]

Defined in subclasses only.

Implements MovementGenerator.

00042 {
00043     flock();
00044     position += direction * speed;
00045     if(testBounds()) {
00046         position += direction * speed * 2;
00047         testBounds();
00048     }
00049 }


The documentation for this class was generated from the following files:

Generated on Fri Sep 19 13:05:07 2008 for ITM OverSim by  doxygen 1.5.5