Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » Turn off random layouting(LayeredLayoutProvider)
Turn off random layouting [message #1758523] Wed, 29 March 2017 14:51 Go to next message
Mehmet Karaman is currently offline Mehmet KaramanFriend
Messages: 63
Registered: November 2012
Location: Berlin
Member
Hello,

is it possible to get deterministic layouting results? I have replaced the InternalProperties.RANDOM property of an lgraph with my own implementation of Random, which simply returns 0 or false in its nextXYZ()-Methods. But there is still a non-deterministic layouting result.

I am using the LayeredLayoutProvider.

Is it possible to turn off random layouting? Thanks in advance.

Best regards
Mehmet Karaman

[Updated on: Wed, 29 March 2017 14:53]

Report message to a moderator

Re: Turn off random layouting [message #1758526 is a reply to message #1758523] Wed, 29 March 2017 15:12 Go to previous messageGo to next message
Ulf Rueegg is currently offline Ulf RueeggFriend
Messages: 26
Registered: February 2010
Junior Member
By default two layouts of the same graph should result in the same drawing.

You shouldn't replace the internal random object and I don't think always returning 0 is a good idea either. There's the layout option
RANDOM_SEED
which is documented as follows
Quote:

Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time).

For elk layered it is set to 1 by default. Additionally the algorithm avoids non-determinism internally, e.g. iterating a hash set.

If you are facing non-deterministic results, it may be a bug. Can you further detail what changes between layouts?
Re: Turn off random layouting [message #1758565 is a reply to message #1758526] Thu, 30 March 2017 07:30 Go to previous messageGo to next message
Mehmet Karaman is currently offline Mehmet KaramanFriend
Messages: 63
Registered: November 2012
Location: Berlin
Member
Thank you for the answer. The node placement is changed and this impacts also the edge routing (there are 4-5 different results possible). We are using the version 0.1.0 of Elk. My next experiment will be checking the Root ElkNode of two layout inputs. If these are the same but the result different, i can conclude that the bug is in ELK. Maybe the problem is in our graph or layout connector.
Re: Turn off random layouting [message #1758581 is a reply to message #1758565] Thu, 30 March 2017 09:31 Go to previous messageGo to next message
Mehmet Karaman is currently offline Mehmet KaramanFriend
Messages: 63
Registered: November 2012
Location: Berlin
Member
Ok, i've found the problem. Our layout input model was created in different order. Thank you.
Re: Turn off random layouting [message #1758594 is a reply to message #1758581] Thu, 30 March 2017 12:01 Go to previous messageGo to next message
Ulf Rueegg is currently offline Ulf RueeggFriend
Messages: 26
Registered: February 2010
Junior Member
Good. I guess it's actually something we should document.
Re: Turn off random layouting [message #1758651 is a reply to message #1758594] Fri, 31 March 2017 08:54 Go to previous message
Mehmet Karaman is currently offline Mehmet KaramanFriend
Messages: 63
Registered: November 2012
Location: Berlin
Member
Maybe FAQ "Localize a problem" entry is enough. Check in steps: own graph model -> Layout Connector -> Elk Layouting -> Layout Connector -> Own Graph model. In ELK 0.2.0 i could see that the problem localization is much easier, the new elk graph viewer to visualize the layouting result is very helpful.
Previous Topic:Problem with edge labels
Next Topic:Feature of adding custom processors in existing layouting algorithms
Goto Forum:
  


Current Time: Tue Oct 08 04:06:35 GMT 2024

Powered by FUDForum. Page generated in 0.04944 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top