55 : TclClass(
"Position/UWGM")
78 , nextUpdateTime_(0.0)
106 if (strcasecmp(argv[1],
"bound") == 0) {
107 if (strcasecmp(argv[2],
"SPHERIC") == 0)
110 if (strcasecmp(argv[2],
"THOROIDAL") == 0)
113 if (strcasecmp(argv[2],
"HARDWALL") == 0)
116 if (strcasecmp(argv[2],
"REBOUNCE") == 0)
120 "UwGMPosition::command(%s), unrecognized "
121 "bound_ type (%s)\n",
131 if (strcasecmp(argv[1],
"speedMean") == 0) {
136 return Position::command(argc, argv);
142 return RNG::defaultrng()->normal(0.0,1.0);
153 printf(
"Update at %.3f(%.3f) old speed %.2f old direction %.2f old "
178 printf(
"X:%.3f->%.3f Y:%.3f->%.3f Z:%.3f->%.3f\n",
290 printf(
"nextUpdateTime = %f, now %f, updateTime %f\n",
299 double now = Scheduler::instance().clock();
308 double now = Scheduler::instance().clock();
317 double now = Scheduler::instance().clock();
Adds the module for UwGMPositionClass in ns2.
TclObject * create(int, const char *const *)
UwGMPosition class implements the Gauss Markov 3D mobility model.
virtual void update(double now)
Method that updates both the position coordinates as function of the number of states to be evaluated...
double Gaussian()
Method that returns a value from a normal random Gaussian variable (zero mean, unitary viariance)
double vx
Temporary variable.
double vz
Temporary variable.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
double alpha_
Parameter to be used to vary the randomness: 0: totally random values (Brownian motion),...
int debug_
Flag to enable or disable dirrefent levels of debug.
double speedMean_
Defines the mean value of the speed, when it is setted to zero the node moves anyway.
double pitchMean_
Mean value for the pitch.
double direction_
Current value of the direction.
virtual ~UwGMPosition()
Destructor of UwGMPosition class.
virtual double getX()
Returns the current projection of the node on the x-axis.
UwGMPosition()
Constructor of UwGMPosition class.
double directionMean_
Defines the mean value of the direction.
double yFieldWidth_
Range of the y-axis of the field to be simulated, in meters.
double nextUpdateTime_
Internal variable used to evaluate the steps to be computed.
virtual double getY()
Returns the current projection of the node on the y-axis.
double vy
Temporary variable.
virtual double getZ()
Returns the current projection of the node on the z-axis.
double speed_
Current value of the speed.
double xFieldWidth_
Range of the x-axis of the field to be simulated, in meters.
double zFieldWidth_
Range of the z-axis of the field to be simulated, in meters.
double updateTime_
Defines the behaviour of the node when it reaches the edge: SPHERIC: return in the simulation field o...
double pitch_
Current value of the pitch.
double alphaPitch_
Pitch of alpha variable.
UwGMPositionClass class_uwgmposition
3D Gauss Markov mobility model.