28 std::random_device rd;
29 _re.seed(_seed = rd());
32 _re.seed(_seed = seed);
48 static std::uniform_real_distribution<T> dist_double;
50 using D = std::decay_t<
decltype(dist_double)>;
51 using P =
typename D::param_type;
52 dist_double.param(
P{min, max});
53 return dist_double(_re);
69 static std::uniform_int_distribution<T> dist_int;
71 using D = std::decay_t<
decltype(dist_int)>;
72 using P =
typename D::param_type;
73 dist_int.param(
P{min, max});
90 assert(!container.empty());
91 size_t index = Integer<size_t>(0, container.size() - 1);
92 auto iter = container.begin();
97 static uint32_t _seed;
98 static std::default_random_engine _re;
static auto & Select(C &container)
从容器随机选择一个
static T Float(T min, T max)
返回[min,max)区间的 浮点数随机值
static T Integer(T min, T max)
返回[min,max]区间的 随机整数
static void SetSeed(uint32_t seed)
设置随机数种子
void log(std::string_view str, const std::source_location location=std::source_location::current())
以当前设置输出