|
|
| 309 |
* \brief Allocate the positions uniformely (with constant density) randomly within a disc. |
309 |
* \brief Allocate the positions uniformely (with constant density) randomly within a disc. |
| 310 |
* |
310 |
* |
| 311 |
* UniformDiscPositionAllocator allocates the positions randomly within a disc \f$ D \f$ lying on the |
311 |
* UniformDiscPositionAllocator allocates the positions randomly within a disc \f$ D \f$ lying on the |
| 312 |
* plane \f$ z=0 \f$ and having center at coordinates \f$ (x,y,0) \f$ |
312 |
* plane \f$ z \f$ and having center at coordinates \f$ (x,y,z) \f$ |
| 313 |
* and radius \f$ \rho \f$. The random positions are chosen such that, |
313 |
* and radius \f$ \rho \f$. The random positions are chosen such that, |
| 314 |
* for any subset \f$ S \subset D \f$, the expected value of the |
314 |
* for any subset \f$ S \subset D \f$, the expected value of the |
| 315 |
* fraction of points which fall into \f$ S \subset D \f$ corresponds |
315 |
* fraction of points which fall into \f$ S \subset D \f$ corresponds |
| 316 |
* to \f$ \frac{|S|}{|D|} \f$, i.e., to the ratio of the area of the |
316 |
* to \f$ \frac{|S|}{|D|} \f$, i.e., to the ratio of the area of the |
| 317 |
* subset to the area of the whole disc. |
317 |
* subset to the area of the whole disc. |
| 318 |
* |
318 |
* |
| 319 |
* \note using UniformDiscPositionAllocator is not equivalent to using |
319 |
* \note using UniformDiscPositionAllocator is not equivalent to using |
| 320 |
* a RandomDiscPositionAllocator with a uniformly-distributed radius, |
320 |
* a RandomDiscPositionAllocator with a uniformly-distributed radius, |
|
|
| 329 |
* \return the object TypeId |
329 |
* \return the object TypeId |
| 330 |
*/ |
330 |
*/ |
| 331 |
static TypeId GetTypeId (void); |
331 |
static TypeId GetTypeId (void); |
|
|
332 |
|
| 333 |
/** |
| 334 |
* \brief Constructor |
| 335 |
*/ |
| 332 |
UniformDiscPositionAllocator (); |
336 |
UniformDiscPositionAllocator (); |
| 333 |
virtual ~UniformDiscPositionAllocator (); |
337 |
virtual ~UniformDiscPositionAllocator (); |
| 334 |
|
338 |
|
| 335 |
/** |
339 |
/** |
| 336 |
* \param rho the value of the radius of the disc |
340 |
* \param rho the value of the radius of the disc |
| 337 |
*/ |
341 |
*/ |
| 338 |
void SetRho (double rho); |
342 |
void SetRho (double rho); |
| 339 |
|
343 |
|
| 340 |
/** |
344 |
/** |
| 341 |
* \param x the X coordinate of the center of the disc |
345 |
* \param x the X coordinate of the center of the disc |
| 342 |
*/ |
346 |
*/ |
| 343 |
void SetX (double x); |
347 |
void SetX (double x); |
| 344 |
|
348 |
|
| 345 |
/** |
349 |
/** |
| 346 |
* \param y the Y coordinate of the center of the disc |
350 |
* \param y the Y coordinate of the center of the disc |
| 347 |
*/ |
351 |
*/ |
| 348 |
void SetY (double y); |
352 |
void SetY (double y); |
|
|
353 |
/** |
| 354 |
* \param z the Z coordinate of all the points |
| 355 |
*/ |
| 356 |
void SetZ (double z); |
| 349 |
|
357 |
|
| 350 |
virtual Vector GetNext (void) const; |
358 |
virtual Vector GetNext (void) const; |
| 351 |
virtual int64_t AssignStreams (int64_t stream); |
359 |
virtual int64_t AssignStreams (int64_t stream); |
| 352 |
private: |
360 |
private: |
| 353 |
Ptr<UniformRandomVariable> m_rv; //!< pointer to uniform random variable |
361 |
Ptr<UniformRandomVariable> m_rv; //!< pointer to uniform random variable |
| 354 |
double m_rho; //!< value of the radius of the disc |
362 |
double m_rho {0.0}; //!< value of the radius of the disc |
| 355 |
double m_x; //!< x coordinate of center of disc |
363 |
double m_x {0.0}; //!< x coordinate of center of disc |
| 356 |
double m_y; //!< y coordinate of center of disc |
364 |
double m_y {0.0}; //!< y coordinate of center of disc |
|
|
365 |
double m_z {0.0}; //!< z coordinate of the points |
| 357 |
}; |
366 |
}; |
| 358 |
|
367 |
|
| 359 |
} // namespace ns3 |
368 |
} // namespace ns3 |