#include <Broadcaster.h>
Inheritance diagram for Broadcaster:
Public Member Functions | |
Broadcaster (char *name, int stackSize, int priority, int id) | |
bool | setClusterPoint (double x, double y) |
bool | getHaveClusterPoint () |
Private Member Functions | |
void | broadcast () |
void | processNextMessage () |
bool | mySenderInactive () |
Private Attributes | |
bool | haveClusterPoint |
bool | senderIsMe |
int | clusterPointDicoveryTime |
int | myID |
int | mySendersID |
Timer | timer |
Radio * | radio |
Drive * | drive |
|
Constructor for Broadcaster. The parameters are passed to the Thread constructor
|
|
The robot broadcasts its current cluster point to all robots in the vicinity until it fails or realizes that a robot with a higher priority is broadcasting as well
|
|
|
|
Checks if the robot from who I got my current cluster point and for who I have to continue broadcasting has failed
|
|
Processes one message in the message buffer. If there are no messages in the buffer it returns immediately. See system model for an explanation how these messages are used to spread the cluster point and to determine a broadcaster |
|
Used to tell the broadcaster to set the robot's cluster point to the passed position. This is only done if Broadcaster::getHaveClusterPoint() returns false, i.e. if no cluster point was chosen yet. Otherwise the broadcaster ignores this command and decides himself which cluster point to use
|
|
Stores the time when the current cluster point was discovered (in hundreth seconds) |
|
The Broadcaster needs the Drive to set the cluster point |
|
Stores if the robot does already have a cluster point |
|
Stores own robot ID for communication |
|
Stores the ID of the robot from who I got my current cluster point and for who I have to continue broadcasting if he fails |
|
The Broadcaster uses the Radio to communicate |
|
A flag that indicates if this robots should broadcast its cluster point |
|
The Broadcaster has a Timer to determine cluster point ages |