Bug 2860 - Add the possibility of changing the z coordinate in GridPositionAllocator, RandomRectanglePositionAllocator, RandomDiscPositionAllocator, UniformDiscPositionAllocator
Add the possibility of changing the z coordinate in GridPositionAllocator, Ra...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: mobility models
ns-3-dev
All All
: P3 enhancement
Assigned To: ns-bugs
:
: 2892 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-26 11:30 UTC by Michele Polese
Modified: 2018-10-15 03:38 UTC (History)
2 users (show)

See Also:


Attachments
Possible patch (7.53 KB, patch)
2018-01-26 11:30 UTC, Michele Polese
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michele Polese 2018-01-26 11:30:55 UTC
Created attachment 3019 [details]
Possible patch

Unless randomly extracted (as in RandomBoxPositionAllocator), the z coordinate in the position-allocator classes is always set to 0. Therefore, it is not "user-friendly" to use a z coordinate different from 0 on nodes whose position is set using the MobilityHelper APIs (one would need to cycle through the nodes and change the z coordinate one by one, I guess).
The proposed patch adds the possibility of setting a common z coordinate (in case different from 0) to all the position extracted from GridPositionAllocator, RandomRectanglePositionAllocator, RandomDiscPositionAllocator, UniformDiscPositionAllocator. This can be done using an attribute or the SetZ method. The default value of the Attribute is set to 0 so that it does not change the current behavior unless the user wants to explicitly set it to a different value.
Comment 1 natale.patriciello 2018-03-08 06:48:40 UTC
*** Bug 2892 has been marked as a duplicate of this bug. ***
Comment 2 natale.patriciello 2018-03-08 07:02:23 UTC
I agree with the patch, if no comments arise, I will push the patch after the 3.28 release.
Comment 3 natale.patriciello 2018-10-12 07:23:38 UTC
Added in 13824:d5e4627b7502, thanks Michele.