GMPosition Class Reference

#include <gmposition.h>

Inheritance diagram for GMPosition:

Inheritance graph
[legend]
Collaboration diagram for GMPosition:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

This class implements the Gauss Markov mobility model. Movement occurs by updating the speed and the direction only when an information regarding node position is required, in this case, if is necessary, all the uncalculated previous states are computed according to a finite state Markov process. The model is designed to adapt to different level of randomness via one tuning parameter (alpha). Initially each node is assigned a current speed and direction, which will be updated during the simulation.

See also:
NodeCore, Position, BMPosition

Definition at line 64 of file gmposition.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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

Parameters:
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)
Returns:
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or no

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().


Member Data Documentation

double GMPosition::speedMean_ [private]

0: totally random values (Brownian motion) 1: linear motion

Definition at line 125 of file gmposition.h.

Referenced by command(), and update().

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().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:48:38 2008 for NS-MIRACLE library by  doxygen 1.5.2