OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000038OMNeT++runtime / Tkenvpublic2008-12-16 09:232010-05-18 17:36
baumgart 
andras 
normaltweakalways
resolvedfixed 
4.0rc1 
4.1rc1 
0000038: Layouter produces strange results, if some nodes are fixed
The basicspringembedderlayout produces strange results if some nodes are fixed.
If e.g. you have one unconnected fixed node and about 100 nodes connected nodes in circle, you'll get a huge canvas - if you remove the fixed node, everything works well.

I've taken a look at the source - there's a comment, that a layout with fixed nodes should not be scaled, so that fixed nodes keep their position. Maybe a fix would be to scale all movable nodes and keep the position of fixed nodes. Of course fixed nodes could get covered in this case - but this problem only occurs if you have a large number of nodes (in this case they currently get covered anyway). If tried the "USE_CONTRACTING_BOX" feature as well, but this seems to be broken (segmentation fault).

BTW, it would also be great to have an option to adapt the size of the canvas used for layouting to the current size of the Tk window. In this case the user could dynamically adapt the canvas size.

I've also tried the new layout mechanism - but this seems to produce worse results and takes very long to complete.
No tags attached.
patch better_layout.patch (3,843) 2009-03-24 18:28
https://dev.omnetpp.org/bugs/file_download.php?file_id=14&type=bug
patch scaleDespiteFixedNodes.patch (2,118) 2010-05-06 17:15
https://dev.omnetpp.org/bugs/file_download.php?file_id=36&type=bug
Issue History
2008-12-16 09:23baumgartNew Issue
2008-12-16 09:23baumgartAssigned To => andras
2009-03-24 18:26baumgartNote Added: 0000134
2009-03-24 18:28baumgartFile Added: better_layout.patch
2010-05-05 16:22andrasNote Added: 0000272
2010-05-05 16:32andrasNote Added: 0000273
2010-05-05 16:32andrasStatusnew => resolved
2010-05-05 16:32andrasFixed in Version => 4.1rc1
2010-05-05 16:32andrasResolutionopen => fixed
2010-05-06 12:12baumgartNote Added: 0000284
2010-05-06 12:12baumgartStatusresolved => feedback
2010-05-06 12:12baumgartResolutionfixed => reopened
2010-05-06 17:15baumgartFile Added: scaleDespiteFixedNodes.patch
2010-05-06 17:16baumgartNote Added: 0000287
2010-05-18 17:36rhornigNote Added: 0000305
2010-05-18 17:36rhornigStatusfeedback => resolved
2010-05-18 17:36rhornigResolutionreopened => fixed

Notes
(0000134)
baumgart   
2009-03-24 18:26   
I've attached a patch, that does the following:
- Scale layout, even with fixed nodes, but keep position of fixed and anchored nodes
- Adjust canvas size to windows size, if no bgb display string is given
- Increased TOutVectorWindow buffer size
(0000272)
andras   
2010-05-05 16:22   
Let us discuss adjusting canvas size to the Tk window size separately -- creating bug 0000165 for that purpose.
(0000273)
andras   
2010-05-05 16:32   
Adjusted both layouting algorithms so that nodes are always placed inside compound module borders (it was an issue that they could get outside). Running test/anim/dynamic2 (a new test) gives good results now. The change to scale and/or shift floating (i.e.movable) nodes after layouting was not applied, because (as the description notes too) their relative positions to fixed/anchored nodes would change, so the result may be completely different (and inferior) to what the layouter produced in the first place. However, layouting parameters have been adjusted, and both layouters should now give better results without scaling as well.
(0000284)
baumgart   
2010-05-06 12:12   
Unfortunately the new layouting mechanism doesn't help for typical OverSim scenarios. The problem remains, that as soon as a single node is fixed, scaling is disabled. The new mechanism now leads to funny results if e.g. we have a ring with a large number of nodes - now many nodes are now placed exactly on the border of the canvas keeping an empty space in the middle.

Of course the relative positions to fixed/anchored nodes would change with the proposed patch - but where is the problem? There should be no relation between fixed and regular nodes (regular nodes get always randomly placed by the layouter, no matter if scaling is enabled or not). And all fixed/anchored nodes are kept at their correct positions with the proposed patch...
(0000287)
baumgart   
2010-05-06 17:16   
Added a new version of the patch (scaleDespiteFixedNodes) for omnetpp-4.1b4 - behavior is disabled by default. To enable set the display string bgb[5] = 1.
(0000305)
rhornig   
2010-05-18 17:36   
Layouter is now fixed to produce acceptable results for the mentioned case.