Visualization problem when using Km as unit

76 views
Skip to first unread message

Antonio Virdis

unread,
May 30, 2017, 6:15:24 AM5/30/17
to OMNeT++ Users
Hi guys,

I'm developing a simulated scenario that is quite large in terms of distances, i.e. in the order of thousands of kilometers.
To do so, in the network definition I'm using the bgu tag to set the unit of measurement to km.
Then I'm specifying the position of nodes:
- within the same NED in terms of Km;
- within the ini file using mobility parameters (thus specifying the unit of measurement)

When I run the simulation in visual mode (either tkenv or qtenv) only the positions that were set via ini are expressed in km, and nodes are thus not displayed correctly.
In other words, the background is small and contains only the nodes whose position is defined via ned, whereas the others are "far far away". (please see the figure in attachment)

Here is a small example of the code I'm using.

[In Ned]
network LargeNetwork
{
    @display("bgb=4000,2900;bgu=km");
    submodules:

        core: Router {
            @display("p=414,852");
        }
        genericGround: GenericGround {
            @display("p=166,534");
        }
        station1: Station {
            @display("p=1,1");
        }
    [ ... ]
}

[In .ini]
*.station1.mobility.initFromDisplayString = false
*.station1.mobility.initialX = 1700 km 
*.station1.mobility.initialY = 600 km 
*.station1.mobility.initialZ = 0 km    




bigScenario.jpeg

Rudolf Hornig

unread,
May 30, 2017, 10:00:33 AM5/30/17
to OMNeT++ Users
The BGU tag is sort of deprecated, or more precisely it was never implemented in INET's mobility modules. I.e. the fact that you specify "km" in the bgu tag has no effect at all in inet. Generally, in INET it was a bad idea, to have a mode where the mobility module initializes the starting coordinates from the display string. I admit it is very convenient if you just want to drop some wireless nodes here and there, but on long term it causes confusion like in this case.

INET's mobility always assumes that the value in the display string is in meters (no matter what you write into the bgu tag). I suggest not to rely on display string coordinates, but rather specify every staring position in the INI file.

Antonio Virdis

unread,
May 30, 2017, 10:15:09 AM5/30/17
to OMNeT++ Users
Thanks Rudolf,

I understand this. What I did is actually specifying all values in the NED referring to meters, i.e. ignoring the bgu tag.

This works fine, but still prevents me from actually visualizing the whole network, as I cannot zoom-out indefinitely using either tkenv nor qtenv. Is there a way to trick them, e.g. by forcing them to display the whole bgb?

Btw, this has no effects on cmd simulations.

Rudolf Hornig

unread,
May 31, 2017, 5:06:26 AM5/31/17
to OMNeT++ Users
There used to be a bgs tag (background scaling), but that was removed because it was basically just the "default zoom level". 

While zoom-out in Qtenv is limited, it's not that bad, but you need to specify:

@display("bgb=4000000,2900000;bgu=km");

for your network. (i.e. the size in pixels). In that setting I was able to zoom out to fit half the module to the whole screen. It's not optimal, but better manageable. 

Antonio Virdis

unread,
May 31, 2017, 5:12:34 AM5/31/17
to OMNeT++ Users
Thanks again.
Btw, I'm able to zoom-out a little bit more using tkenv.
This will do the job.

Rudolf Hornig

unread,
May 31, 2017, 5:15:57 AM5/31/17
to OMNeT++ Users
Actually, the proper solution would be to implement a scaling parameter in INET which would specify how to map meters to pixels. 

Antonio Virdis

unread,
May 31, 2017, 5:21:12 AM5/31/17
to omn...@googlegroups.com
This would also mean that positions in NED are expressed in pixels. The manual still says they are in meters and INET seems to fill displaystring accordingly.


--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/dO-4-0P5JK0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.



--
Antonio Virdis

Rudolf Hornig

unread,
May 31, 2017, 7:01:22 AM5/31/17
to OMNeT++ Users


On Wednesday, 31 May 2017 11:21:12 UTC+2, Antonio Virdis wrote:
This would also mean that positions in NED are expressed in pixels.
Yes. In fact, in long term, it would be ideal to decouple the position of the nodes in the display string from the physical positions of the nodes. Rather, there should be a separate *physical* view which would reflect the physical position of the node and the current view could be used as a *logical* view. But this is just for the future...

The manual still says they are in meters and INET seems to fill displaystring accordingly.
Can you point me to the actual passage in the manual. We should fix that.

Antonio Virdis

unread,
May 31, 2017, 7:08:37 AM5/31/17
to omn...@googlegroups.com
Actually, the only place where it is explicitly stated is in Section "24.1 Module and Connection Display String Tags" when defining the bgu tag.
Reply all
Reply to author
Forward
0 new messages