129 void seed(uint64_t seed);
166 void configure(
const std::string& key, std::any value);
173 [[nodiscard]] std::optional<std::any> get_config(
const std::string& key)
const;
183 [[nodiscard]]
double operator()(
double min,
double max);
192 [[nodiscard]]
double at(
double x,
double y = 0.0,
double z = 0.0);
201 [[nodiscard]] std::vector<double> batch(
double min,
double max,
size_t count);
310 [[nodiscard]]
double generate_memoryless(
double min,
double max);
311 [[nodiscard]]
double generate_stateful(
double min,
double max);
312 [[nodiscard]]
double generate_perlin_impl(
double x,
double y,
double z);
313 [[nodiscard]]
double generate_gendy_impl(
double min,
double max);
314 [[nodiscard]]
double generate_brownian_impl(
double min,
double max);
315 [[nodiscard]]
double generate_colored_noise_impl(
double min,
double max);
317 void validate_range(
double min,
double max)
const;
318 void rebuild_distributions_if_needed(
double min,
double max);
322 m_xorshift_state ^= m_xorshift_state >> 12;
323 m_xorshift_state ^= m_xorshift_state << 25;
324 m_xorshift_state ^= m_xorshift_state >> 27;
325 return static_cast<double>(m_xorshift_state * 0x2545F4914F6CDD1DULL)
326 * (1.0 / 18446744073709551616.0);
336 std::normal_distribution<double> m_normal_dist { 0.0, 1.0 };
337 std::exponential_distribution<double> m_exponential_dist { 1.0 };
339 double m_cached_min { 0.0 };
340 double m_cached_max { 1.0 };
341 bool m_dist_dirty {
true };
372 gen.
configure(
"persistence", persistence);
384 gen.
configure(
"breakpoints", breakpoints);
uint64_t m_xorshift_state
std::map< std::string, std::any > m_config
GeneratorState & state_mutable()
Gets mutable internal state.
void configure(const std::string &key, std::any value)
Configures algorithm-specific parameters.
Algorithm get_algorithm() const
Gets current algorithm.
double fast_uniform() noexcept
const GeneratorState & state() const
Gets current internal state.
Unified generative infrastructure for stochastic and procedural algorithms.
Stochastic gendy(int breakpoints=12)
Creates Gendy dynamic stochastic generator.
Stochastic perlin(int octaves=4, double persistence=0.5)
Creates Perlin noise generator.
Stochastic brownian(double step_size=0.01)
Creates Brownian motion generator.
Stochastic uniform()
Creates uniform random generator.
Stochastic gaussian(double spread=4.0)
Creates Gaussian random generator.
Algorithm
Stochastic and procedural generation algorithms.
std::vector< double > internal_buffer
std::map< std::string, std::any > algorithm_specific
Encapsulates internal state for stateful generators.