New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement OpenBabel::OBRandom as a wrapper of std::mt19937_64 #2241
base: master
Are you sure you want to change the base?
Conversation
a4075bd
to
f22042d
Compare
Looks like a good idea. One thing that's been requested to add an OBOp plugin to set the RNG seed (e.g., #1934) - would you be willing to add that too. |
I've said it before but we should be working to remove all uses of random numbers in the library. |
@baoilleach - I don't think that's possible. It's good to minimize them, allow a defined seed to be set, etc. but stochastic methods are critical to several tasks in the library. |
a11ad5e
to
571a1cb
Compare
We've generally said that only major version changes (e.g., OB2 => OB3 or OB3 => OB4) would drop functions / methods. The general concept is great, but can we either keep the existing code for backwards compatibility and add a new OBRandomMT class to use in conformer search, etc.? The other alternative would be to replace with the current code but wrap previous methods for backwards compatibility. Otherwise we have to leave this for a while. |
f62b547
to
3f82d3a
Compare
Done. At the moment, i.e. |
@e-kwsm thanks for such opportunity to fix seeds for reproducibility! However after build this pr I still can't repeat results when call obabel from bash, both putting seed argument in and after setting environment variable, for example for this CC1=CC(CNC2=CC=C(NC3CCC4=CC=C(C5=NNN=N5)C=C43)C=C2NC2=CC=C(F)N=C2F)=NC(C)=N1 mol. I build library with 3 option from here. Could you please suggest some workaround? |
@alexander-telepov You have to build Open Babel with |
@e-kwsm Thanks for such fast reply! |
- UniformInt - UniformReal - Normal - Bernoulli
deprecates OpenBabel::OBRandom
this is enabled if OB_USE_IMPROVED_RANDOM_UNIT_VECTOR, which defaults to whether OpenBabel 4 is released or not, is defined as truthy
the macro defaults to whether OpenBabel 4 is released or not
Mersenne twister is one of high-quality PRNGs and available on all platforms since C++11.