greatGathering Class Reference

greatGathering class More...

#include <greatGathering.h>

Inheritance diagram for greatGathering:
MovementGenerator

List of all members.

Public Member Functions

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

Detailed Description

greatGathering class

Simulates many nodes gathering at one spot.

Definition at line 34 of file greatGathering.h.


Constructor & Destructor Documentation

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

Definition at line 26 of file greatGathering.cc.

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]

Definition at line 38 of file greatGathering.h.

00038 {}


Member Function Documentation

void greatGathering::move (  )  [virtual]

Defined in subclasses only.

Implements MovementGenerator.

Definition at line 41 of file greatGathering.cc.

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 Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3