1 #ifndef PIXLED_FUNCTIONNAL_RANDOM_H
2 #define PIXLED_FUNCTIONNAL_RANDOM_H
5 #include <unordered_map>
7 #include "../function.h"
16 namespace pixled {
namespace random {
55 std::random_device rd_seeder;
56 std::uniform_int_distribution<unsigned long> rd_seed;
57 seed = rd_seed(rd_seeder);
77 mutable time current_period = 0;
97 mutable time current_period = 0;
99 mutable std::uniform_int_distribution<unsigned long> rd_seed;
100 mutable std::unordered_map<index_t, random_engine> rds;
126 public Function<UniformDistribution<R>, R, R, R, random_engine> {
136 std::uniform_real_distribution<float> random_real (
137 this->
template call<0>(l, t), this->
template call<1>(l, t)
139 auto engine = this->
template call<2>(l, t);
140 return random_real(engine);
163 std::normal_distribution<float> random_real (
164 this->
template call<0>(l, t), this->
template call<1>(l, t)
166 auto engine = this->
template call<2>(l, t);
167 return random_real(engine);
Definition: function.h:349
Function(Fcts &&... fcts)
Definition: function.h:383
Definition: function.h:33
R operator()(led l, time t) const override
Definition: random.h:162
time period
Definition: random.h:37
unsigned long seed
Definition: random.h:41
RandomEngineConfig(time period, unsigned long seed)
Definition: random.h:65
RandomEngineConfig(time period)
Definition: random.h:53
random_engine operator()(led l, time t) const override
Definition: random.cpp:5
RandomT * copy() const override
Definition: random.h:84
RandomXYT * copy() const override
Definition: random.h:109
random_engine operator()(led l, time t) const override
Definition: random.cpp:14
Definition: animation.cpp:3
std::minstd_rand random_engine
Definition: random.h:13
unsigned long time
Definition: time.h:10