6 : m_engine(
std::random_device {}())
8 , m_xorshift_state(
std::random_device {}() | (static_cast<uint64_t>(
std::random_device {}()) << 32))
16 m_engine.seed(
static_cast<std::mt19937::result_type
>(
seed));
79 throw std::runtime_error(
"Multi-dimensional access only supported for PERLIN algorithm");
88 std::vector<double> result;
89 result.reserve(
count);
91 for (
size_t i = 0; i <
count; ++i) {
92 result.push_back((*
this)(min, max));
111 double raw_value = 0.0;
120 return std::clamp(raw_value, min, max);
127 return min + raw_value * (max - min);
131 std::poisson_distribution<int> dist(
static_cast<int>(max - min));
132 return static_cast<double>(dist(
m_engine));
158 double step_size = 0.01;
159 if (
auto cfg =
get_config(
"step_size"); cfg.has_value()) {
160 step_size = std::any_cast<double>(*cfg);
179 throw std::invalid_argument(
"Stochastic: min must be <= max");
188 const double range = max - min;
192 if (
auto cfg =
get_config(
"spread"); cfg.has_value()) {
193 spread = std::any_cast<double>(*cfg);
195 m_normal_dist = std::normal_distribution<double>(0.0, range / spread);
void validate_range(double min, double max) const
double generate_stateful(double min, double max)
uint64_t m_xorshift_state
double generate_gendy_impl(double min, double max)
std::map< std::string, std::any > m_config
void configure(const std::string &key, std::any value)
Configures algorithm-specific parameters.
void rebuild_distributions_if_needed(double min, double max)
std::vector< double > batch(double min, double max, size_t count)
Batch generation.
void reset_state()
Resets internal state for stateful algorithms.
double generate_brownian_impl(double min, double max)
std::optional< std::any > get_config(const std::string &key) const
Gets configuration parameter.
double generate_perlin_impl(double x, double y, double z)
double operator()(double min, double max)
Generates single value in range.
std::exponential_distribution< double > m_exponential_dist
double at(double x, double y=0.0, double z=0.0)
Multi-dimensional generation (Perlin, spatial noise)
void set_algorithm(Algorithm algo)
Changes active algorithm.
std::normal_distribution< double > m_normal_dist
double fast_uniform() noexcept
double generate_memoryless(double min, double max)
double generate_colored_noise_impl(double min, double max)
void seed(uint64_t seed)
Seeds entropy source.
Unified generative infrastructure for stochastic and procedural algorithms.
Algorithm
Stochastic and procedural generation algorithms.