|
Lines 114-119
GridPositionAllocator::GetTypeId (void)
|
Link Here
|
|---|
|
| 114 |
DoubleValue (0.0), |
114 |
DoubleValue (0.0), |
| 115 |
MakeDoubleAccessor (&GridPositionAllocator::m_yMin), |
115 |
MakeDoubleAccessor (&GridPositionAllocator::m_yMin), |
| 116 |
MakeDoubleChecker<double> ()) |
116 |
MakeDoubleChecker<double> ()) |
|
|
117 |
.AddAttribute ("Z", |
| 118 |
"The z coordinate of all the positions allocated.", |
| 119 |
DoubleValue (0.0), |
| 120 |
MakeDoubleAccessor (&GridPositionAllocator::m_z), |
| 121 |
MakeDoubleChecker<double> ()) |
| 117 |
.AddAttribute ("DeltaX", "The x space between objects.", |
122 |
.AddAttribute ("DeltaX", "The x space between objects.", |
| 118 |
DoubleValue (1.0), |
123 |
DoubleValue (1.0), |
| 119 |
MakeDoubleAccessor (&GridPositionAllocator::m_deltaX), |
124 |
MakeDoubleAccessor (&GridPositionAllocator::m_deltaX), |
|
Lines 146-151
GridPositionAllocator::SetMinY (double yMin)
|
Link Here
|
|---|
|
| 146 |
m_yMin = yMin; |
151 |
m_yMin = yMin; |
| 147 |
} |
152 |
} |
| 148 |
void |
153 |
void |
|
|
154 |
GridPositionAllocator::SetZ (double z) |
| 155 |
{ |
| 156 |
m_z = z; |
| 157 |
} |
| 158 |
void |
| 149 |
GridPositionAllocator::SetDeltaX (double deltaX) |
159 |
GridPositionAllocator::SetDeltaX (double deltaX) |
| 150 |
{ |
160 |
{ |
| 151 |
m_deltaX = deltaX; |
161 |
m_deltaX = deltaX; |
|
Lines 212-218
GridPositionAllocator::GetNext (void) const
|
Link Here
|
|---|
|
| 212 |
break; |
222 |
break; |
| 213 |
} |
223 |
} |
| 214 |
m_current++; |
224 |
m_current++; |
| 215 |
return Vector (x, y, 0.0); |
225 |
return Vector (x, y, m_z); |
| 216 |
} |
226 |
} |
| 217 |
|
227 |
|
| 218 |
int64_t |
228 |
int64_t |
|
Lines 239-245
RandomRectanglePositionAllocator::GetTypeId (void)
|
Link Here
|
|---|
|
| 239 |
"A random variable which represents the y coordinate of a position in a random rectangle.", |
249 |
"A random variable which represents the y coordinate of a position in a random rectangle.", |
| 240 |
StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=1.0]"), |
250 |
StringValue ("ns3::UniformRandomVariable[Min=0.0|Max=1.0]"), |
| 241 |
MakePointerAccessor (&RandomRectanglePositionAllocator::m_y), |
251 |
MakePointerAccessor (&RandomRectanglePositionAllocator::m_y), |
| 242 |
MakePointerChecker<RandomVariableStream> ()); |
252 |
MakePointerChecker<RandomVariableStream> ()) |
|
|
253 |
.AddAttribute ("Z", |
| 254 |
"The z coordinate of all the positions allocated.", |
| 255 |
DoubleValue (0.0), |
| 256 |
MakeDoubleAccessor (&RandomRectanglePositionAllocator::m_z), |
| 257 |
MakeDoubleChecker<double> ()) |
| 258 |
; |
| 243 |
return tid; |
259 |
return tid; |
| 244 |
} |
260 |
} |
| 245 |
|
261 |
|
|
Lines 260-272
RandomRectanglePositionAllocator::SetY (Ptr<RandomVariableStream> y)
|
Link Here
|
|---|
|
| 260 |
{ |
276 |
{ |
| 261 |
m_y = y; |
277 |
m_y = y; |
| 262 |
} |
278 |
} |
|
|
279 |
void |
| 280 |
RandomRectanglePositionAllocator::SetZ (double z) |
| 281 |
{ |
| 282 |
m_z = z; |
| 283 |
} |
| 263 |
|
284 |
|
| 264 |
Vector |
285 |
Vector |
| 265 |
RandomRectanglePositionAllocator::GetNext (void) const |
286 |
RandomRectanglePositionAllocator::GetNext (void) const |
| 266 |
{ |
287 |
{ |
| 267 |
double x = m_x->GetValue (); |
288 |
double x = m_x->GetValue (); |
| 268 |
double y = m_y->GetValue (); |
289 |
double y = m_y->GetValue (); |
| 269 |
return Vector (x, y, 0.0); |
290 |
return Vector (x, y, m_z); |
| 270 |
} |
291 |
} |
| 271 |
|
292 |
|
| 272 |
int64_t |
293 |
int64_t |
|
Lines 374-379
RandomDiscPositionAllocator::GetTypeId (void)
|
Link Here
|
|---|
|
| 374 |
DoubleValue (0.0), |
395 |
DoubleValue (0.0), |
| 375 |
MakeDoubleAccessor (&RandomDiscPositionAllocator::m_y), |
396 |
MakeDoubleAccessor (&RandomDiscPositionAllocator::m_y), |
| 376 |
MakeDoubleChecker<double> ()) |
397 |
MakeDoubleChecker<double> ()) |
|
|
398 |
.AddAttribute ("Z", |
| 399 |
"The z coordinate of all the positions in the disc.", |
| 400 |
DoubleValue (0.0), |
| 401 |
MakeDoubleAccessor (&RandomDiscPositionAllocator::m_z), |
| 402 |
MakeDoubleChecker<double> ()) |
| 377 |
; |
403 |
; |
| 378 |
return tid; |
404 |
return tid; |
| 379 |
} |
405 |
} |
|
Lines 405-410
RandomDiscPositionAllocator::SetY (double y)
|
Link Here
|
|---|
|
| 405 |
{ |
431 |
{ |
| 406 |
m_y = y; |
432 |
m_y = y; |
| 407 |
} |
433 |
} |
|
|
434 |
void |
| 435 |
RandomDiscPositionAllocator::SetZ (double z) |
| 436 |
{ |
| 437 |
m_z = z; |
| 438 |
} |
| 408 |
Vector |
439 |
Vector |
| 409 |
RandomDiscPositionAllocator::GetNext (void) const |
440 |
RandomDiscPositionAllocator::GetNext (void) const |
| 410 |
{ |
441 |
{ |
|
Lines 413-419
RandomDiscPositionAllocator::GetNext (void) const
|
Link Here
|
|---|
|
| 413 |
double x = m_x + std::cos (theta) * rho; |
444 |
double x = m_x + std::cos (theta) * rho; |
| 414 |
double y = m_y + std::sin (theta) * rho; |
445 |
double y = m_y + std::sin (theta) * rho; |
| 415 |
NS_LOG_DEBUG ("Disc position x=" << x << ", y=" << y); |
446 |
NS_LOG_DEBUG ("Disc position x=" << x << ", y=" << y); |
| 416 |
return Vector (x, y, 0.0); |
447 |
return Vector (x, y, m_z); |
| 417 |
} |
448 |
} |
| 418 |
|
449 |
|
| 419 |
int64_t |
450 |
int64_t |
|
Lines 450-455
UniformDiscPositionAllocator::GetTypeId (void)
|
Link Here
|
|---|
|
| 450 |
DoubleValue (0.0), |
481 |
DoubleValue (0.0), |
| 451 |
MakeDoubleAccessor (&UniformDiscPositionAllocator::m_y), |
482 |
MakeDoubleAccessor (&UniformDiscPositionAllocator::m_y), |
| 452 |
MakeDoubleChecker<double> ()) |
483 |
MakeDoubleChecker<double> ()) |
|
|
484 |
.AddAttribute ("Z", |
| 485 |
"The z coordinate of all the positions in the disc.", |
| 486 |
DoubleValue (0.0), |
| 487 |
MakeDoubleAccessor (&UniformDiscPositionAllocator::m_z), |
| 488 |
MakeDoubleChecker<double> ()) |
| 453 |
; |
489 |
; |
| 454 |
return tid; |
490 |
return tid; |
| 455 |
} |
491 |
} |
|
Lines 477-482
UniformDiscPositionAllocator::SetY (double y)
|
Link Here
|
|---|
|
| 477 |
{ |
513 |
{ |
| 478 |
m_y = y; |
514 |
m_y = y; |
| 479 |
} |
515 |
} |
|
|
516 |
void |
| 517 |
UniformDiscPositionAllocator::SetZ (double z) |
| 518 |
{ |
| 519 |
m_z = z; |
| 520 |
} |
| 480 |
Vector |
521 |
Vector |
| 481 |
UniformDiscPositionAllocator::GetNext (void) const |
522 |
UniformDiscPositionAllocator::GetNext (void) const |
| 482 |
{ |
523 |
{ |
|
Lines 491-497
UniformDiscPositionAllocator::GetNext (void) const
|
Link Here
|
|---|
|
| 491 |
x += m_x; |
532 |
x += m_x; |
| 492 |
y += m_y; |
533 |
y += m_y; |
| 493 |
NS_LOG_DEBUG ("Disc position x=" << x << ", y=" << y); |
534 |
NS_LOG_DEBUG ("Disc position x=" << x << ", y=" << y); |
| 494 |
return Vector (x, y, 0.0); |
535 |
return Vector (x, y, m_z); |
| 495 |
} |
536 |
} |
| 496 |
|
537 |
|
| 497 |
int64_t |
538 |
int64_t |