Issue1032

Title Use RNG class in VariableOrderFinder
Priority feature Status resolved
Superseder Nosy List jendrik, malte, silvan
Assigned To silvan Keywords
Optional summary

Created on 2021-08-03.17:44:16 by silvan, last changed by malte.

Messages
msg10401 (view) Author: malte Date: 2021-08-06.19:04:39
Thanks! :-)
msg10400 (view) Author: silvan Date: 2021-08-06.18:36:41
I prefer the first option and implemented it.
msg10399 (view) Author: malte Date: 2021-08-06.17:44:30
Yes, I looked at the code and understand where this is coming from, but we shouldn't expose a random seed option to the user for components that are not random.

Two not too invasive options:

- Make the RNG parameter to VariableOrderFinder optional (e.g. passing a pointer rather than reference) and assert that it is non-null for the options that use randomness.

- Rather than getting an RNG from the command line in the greedy generator pattern generator, have it create its own RNG object and pass this to the variable order finder.

The drawback of the second one is that creating an RNG object for the Mersenne Twister is actually quite expensive.
msg10398 (view) Author: silvan Date: 2021-08-06.17:36:50
I fixed the first (added the option twice).

The second and third now have a random_seed option because the greedy pattern generator uses VariableOrderFinder to pick variables in the "causal graph level" order. With the change of the issue, VariableOrderFinder now requires a random_seed, which, of course, is only used with the random order options of VariableOrderFinder. 

Maybe a cleaner solution would have been to also expose the variable order type of the greedy pattern generator, together with the random seed.

The combo generator uses the greedy generator.
msg10397 (view) Author: malte Date: 2021-08-06.17:30:31
This triggered some doc changes that look suspicious.

On the MergeTree page, the "linear" plug now has two arguments called "random_seed", one at the start and one at the end of the argument list.

On the PatternGenerator page, "greedy" now has a random_seed option even though the configuration doesn't use random numbers (as far as I can tell).

On the PatternCollectionGenerator, "combo" now has a random_seed option even though the configuration doesn't use random numbers (as far as I can tell).
msg10396 (view) Author: silvan Date: 2021-08-06.15:05:14
Merged.
msg10390 (view) Author: silvan Date: 2021-08-05.10:48:25
Sorry, I indeed misses that the notification email was longer than I saw. I addressed the comments and added a change log. I will merge later if I don't hear anything else.
msg10389 (view) Author: jendrik Date: 2021-08-05.10:42:53
I think you missed two of my comments (regarding emplace_back() and the "algorithm" include). Apart from these, looks good to merge.
msg10386 (view) Author: malte Date: 2021-08-04.13:59:51
I've had a quick look, no objections to merging once you add a change log entry (in this case a "for developers") one. Not sure if everybody saw it, we recently discussed on Discord to have a changelog entry for every issue, whereas previously we left it a little bit open for internal changes like these. (Of course, feel free to reopen this discussion.)
msg10383 (view) Author: silvan Date: 2021-08-04.08:19:11
I addressed it.
msg10382 (view) Author: jendrik Date: 2021-08-03.22:16:12
Thanks for looking into this! I left some comments on GitHub.
msg10378 (view) Author: silvan Date: 2021-08-03.18:24:48
Pull request: https://github.com/aibasel/downward/pull/62
msg10377 (view) Author: silvan Date: 2021-08-03.17:44:12
VariableOrderFinder currently uses std::random_shuffle instead of our own RNG class. This should be changed.
History
Date User Action Args
2021-08-06 19:04:39maltesetmessages: + msg10401
2021-08-06 18:36:41silvansetmessages: + msg10400
2021-08-06 17:44:30maltesetmessages: + msg10399
2021-08-06 17:36:50silvansetmessages: + msg10398
2021-08-06 17:30:31maltesetmessages: + msg10397
2021-08-06 15:05:16silvansetstatus: reviewing -> resolved
messages: + msg10396
2021-08-05 10:48:25silvansetmessages: + msg10390
2021-08-05 10:42:54jendriksetmessages: + msg10389
2021-08-04 13:59:51maltesetmessages: + msg10386
2021-08-04 08:19:11silvansetmessages: + msg10383
2021-08-03 22:16:12jendriksetstatus: in-progress -> reviewing
messages: + msg10382
2021-08-03 18:24:48silvansetmessages: + msg10378
2021-08-03 17:44:16silvancreate