12 #ifndef NURANDOM_RANDOMUTILS_PROVIDERS_RANDOMPOLICY_H 13 #define NURANDOM_RANDOMUTILS_PROVIDERS_RANDOMPOLICY_H 1 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;
105 std::chrono::system_clock::now().time_since_epoch().count()
113 template <
typename SEED>
117 <<
"\n master seed: " <<
random_seed->master_seed()
129 #endif // NURANDOM_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.
Defines an interface for random seed assignment policies.
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
std::optional< T > get_if_present(std::string const &key) const
virtual void print(std::ostream &out) const override
Prints the details of the configuration of the random generator.
RandomPolicy(fhicl::ParameterSet const &pset)