Bug 2860

Summary: Add the possibility of changing the z coordinate in GridPositionAllocator, RandomRectanglePositionAllocator, RandomDiscPositionAllocator, UniformDiscPositionAllocator
Product: ns-3 Reporter: Michele Polese <michele.polese>
Component: mobility modelsAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: enhancement CC: michele.polese, natale.patriciello
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Possible patch

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.