I don't understand. We are talking about requirements here. Are you asking that, if the user changes the coordinate system from cartesian to geographical, then, for example, RandomRectanglePositionAllocator will allocate positions using random latitude and longitude instead of random x and y?
that would help, but I agree with your point in 4)
1) stick with maintaining the positions as cartesian coordinates only
I see your point
2) provide conversion tools from/to your custom coordinate system
I can use my WOSS library for that and wrap it in a new ns3 object.
3) your underwater propagation model will just use the conversion tools to work with the desired coordinate system
yes
4) you should develop new PositionAllocators that allow the end-user to use your coordinates, but leave the PositionAllocators::GetNext () API as-is (i.e., returning cartesian coordinates). Example: you could write a RandomMercatorRectanglePositionAllocator that allocates position in a rectangle on earth surface as defined by the Mercator projection.
understood
5) as for random mobility models: RandomWaypointMobilityModel can work as-is (using your new PositionAllocator for the waypoints), though it can generate artifacts (e.g., a node moving between two points close to the sea floor might travel below the sea floor itself).
agreed, I should probably develop a custom waypoint, based on the one I already developed for Miracle, since great circles distances comes into play when moving on a spherical surface.
Other mobility models probably just can't be reused (e.g., RandomDirection2dMobilityModel works with a rectangle lying on the X-Y plane).
My suggestion is to develop custom mobility models that updates the (cartesian) position of the nodes according to some equation of realistic movement on the earth's surface.
understood.
I think it's all clear, if any issue comes up I'll let you all know
Thanks again all of you for the help!
Best Regards,
Federico Guerra
http://www.guerra-tlc.com________________________________
Da: Nicola Baldo <
nbaldo@...>
A: ns-developers <
ns-developers@...>
Inviato: Mercoledì 18 Aprile 2012 14:25
Oggetto: Re: [Ns-developers] [ns3] Vector and different coordinates system (Federico Guerra) (Nicola Baldo)
Federico Guerra wrote:
> Nicola Baldo wrote:
>> 4) the coordinate system of point 1) is also expected to be used by the
>> user writing the simulation program, to specify the position of the
>> nodes in the simulation. Is this correct?
>>
>
> Correct, all mobility models that places nodes in some box or in a vector list would be affected.
I don't understand. We are talking about requirements here. Are you asking that, if the user changes the coordinate system from cartesian to geographical, then, for example, RandomRectanglePositionAllocator will allocate positions using random latitude and longitude instead of random x and y?
> The main question remains open, though, how integrate a new coordinates system within the ns3 framework, without disrupting existing code.
My suggestion is to:
1) stick with maintaining the positions as cartesian coordinates only
2) provide conversion tools from/to your custom coordinate system
3) your underwater propagation model will just use the conversion tools to work with the desired coordinate system
4) you should develop new PositionAllocators that allow the end-user to use your coordinates, but leave the PositionAllocators::GetNext () API as-is (i.e., returning cartesian coordinates). Example: you could write a RandomMercatorRectanglePositionAllocator that allocates position in a rectangle on earth surface as defined by the Mercator projection.
5) as for random mobility models: RandomWaypointMobilityModel can work as-is (using your new PositionAllocator for the waypoints), though it can generate artifacts (e.g., a node moving between two points close to the sea floor might travel below the sea floor itself).
Other mobility models probably just can't be reused (e.g., RandomDirection2dMobilityModel works with a rectangle lying on the X-Y plane).
My suggestion is to develop custom mobility models that updates the (cartesian) position of the nodes according to some equation of realistic movement on the earth's surface.
Finally, as for the conversion of coordinates, please also have a look to the recently-merged antenna model, there are already conversion for the theta and phi of a spherical coordinate system (not the radius, since it is not needed for antenna radiation patterns). By the way, the AntennaModel is an example of model that works with a non-cartesian
system without needing to modify the core ns-3 cartesian mobility model.
Regards,
Nicola