12 #ifndef NUTOOLS_RANDOMUTILS_PROVIDERS_RANDOMPOLICY_H 13 #define NUTOOLS_RANDOMUTILS_PROVIDERS_RANDOMPOLICY_H 1 26 #include "nutools/RandomUtils/Providers/RandomSeedPolicyBase.h" 42 template <
typename SEED>
43 class RandomPolicy:
public RandomSeedPolicyBase<SEED> {
66 virtual void print(std::ostream& out)
const override;
92 {
return (*random_seed)(); }
97 template <
typename SEED>
99 constexpr
seed_t MagicMaxSeed = 900000000;
113 template <
typename SEED>
117 <<
"\n master seed: " <<
random_seed->master_seed()
129 #endif // NUTOOLS_RANDOMUTILS_PROVIDERS_RANDOMPOLICY_H SEED seed_t
type of the random seed
std::unique_ptr< RandomImpl > random_seed
seed_t seed
seed given at construction, for the record
virtual seed_t createSeed(SeedMasterHelper::EngineId const &) override
Extracts a random seed.
virtual void print(std::ostream &out) const
Prints information on the configuration of this policy.
seed_t master_seed() const
Implementation of the "random" policy.
RandomImpl(seed_t master_seed, seed_t min_seed, seed_t max_seed)
Interface for a policy implementation.
Identifier for a engine, made of module name and optional instance name.
bool get_if_present(std::string const &key, T &value) const
virtual void configure(fhicl::ParameterSet const &pset) override
Configure this policy.
std::uniform_int_distribution< seed_t > distribution
flat
std::default_random_engine generator
random engine
virtual void print(std::ostream &out) const override
Prints the details of the configuration of the random generator.
RandomPolicy(fhicl::ParameterSet const &pset)