Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++11 modify values in std::discrete_distribution

Is it possible to modify single value in std::discrete_distribution? I can't find a simple way of doing this. I was thinking of initializing it with std::vector with assigned probabilities and modifying it everytime I want, but reinitializing discrete_distribution everytime seems to be not the best idea.

like image 943
pablo432 Avatar asked Nov 09 '22 19:11

pablo432


1 Answers

You can't, there's no following function in std::discrete_distribution. You can get probabilities, but not set, so, there is only one way - reinit discrete_distribuion (probably you can use vector of predefined destributions).

like image 93
ForEveR Avatar answered Nov 14 '22 22:11

ForEveR