#include <gmposition.h>
Inheritance diagram for GMPosition:
Public Member Functions | |
GMPosition () | |
virtual | ~GMPosition () |
virtual double | getX () |
virtual double | getY () |
virtual int | command (int argc, const char *const *argv) |
Private Member Functions | |
void | update (double now) |
double | Gaussian () |
Private Attributes | |
double | xFieldWidth_ |
double | yFieldWidth_ |
range of the x-axis of the field to be simulated | |
double | alpha_ |
range of the y-axis of the field to be simulated | |
double | speedMean_ |
double | directionMean_ |
when it is setted to zero the node moves anyway | |
BoundType | bound_ |
Defines the mean value of the direction. | |
double | updateTime_ |
double | nextUpdateTime_ |
Time between two update computation. | |
double | speed_ |
Intenal variable used to evaluate the steps to be computed. | |
double | direction_ |
current value of the speed | |
int | debug_ |
current value of the direction |
Definition at line 64 of file gmposition.h.
GMPosition::GMPosition | ( | ) |
Constructor
Definition at line 45 of file gmposition.cc.
References alpha_, debug_, directionMean_, updateTime_, xFieldWidth_, and yFieldWidth_.
GMPosition::~GMPosition | ( | ) | [virtual] |
Destructor
Definition at line 67 of file gmposition.cc.
double GMPosition::getX | ( | ) | [virtual] |
Method that return the current projection of the node on the x-axis. If it's necessary (updating time ia expired), update the position values before returns it.
Reimplemented from Position.
Definition at line 253 of file gmposition.cc.
References nextUpdateTime_, update(), and Position::x_.
Here is the call graph for this function:
double GMPosition::getY | ( | ) | [virtual] |
Method that return the current projection of the node on the y-axis. If it's necessary (updating time ia expired), update the position values before returns it.
Reimplemented from Position.
Definition at line 261 of file gmposition.cc.
References nextUpdateTime_, update(), and Position::y_.
Here is the call graph for this function:
int GMPosition::command | ( | int | argc, | |
const char *const * | argv | |||
) | [virtual] |
TCL command intepreter
Moreover it inherits all the OTcl method of Position
argc | number of arguments in argv | |
argv | array of strings which are the comand parameters (Note that argv[0] is the name of the object) |
Reimplemented from Position.
Definition at line 71 of file gmposition.cc.
References bound_, Position::command(), speed_, and speedMean_.
Here is the call graph for this function:
void GMPosition::update | ( | double | now | ) | [private] |
Method that updates both the position coordinates as function of the number of states to be evaluated.
Definition at line 142 of file gmposition.cc.
References alpha_, bound_, debug_, direction_, directionMean_, Gaussian(), nextUpdateTime_, speed_, speedMean_, updateTime_, Position::x_, xFieldWidth_, Position::y_, and yFieldWidth_.
Referenced by getX(), and getY().
Here is the call graph for this function:
double GMPosition::Gaussian | ( | ) | [private] |
Method that returns a value from a normal random Gaussian variable (zero mean, unitary viariance)
Definition at line 112 of file gmposition.cc.
Referenced by update().
double GMPosition::speedMean_ [private] |
0: totally random values (Brownian motion) 1: linear motion
Definition at line 125 of file gmposition.h.
double GMPosition::directionMean_ [private] |
when it is setted to zero the node moves anyway
Defines the mean value of the speed
Definition at line 127 of file gmposition.h.
Referenced by GMPosition(), and update().
double GMPosition::updateTime_ [private] |
SPHERIC: return in the simulation field on the opposite side THOROIDAL: return in the centre of simulation field HARDWALL: the movement is stopped in the edge REBOUNCE: the node rebounce (i.e., the movement that should be outside the simulation field is mirrored inside)
Definition at line 134 of file gmposition.h.
Referenced by GMPosition(), and update().