MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ generate_brownian_impl()

double MayaFlux::Kinesis::Stochastic::Stochastic::generate_brownian_impl ( double  min,
double  max 
)
private

Definition at line 156 of file Stochastic.cpp.

157{
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);
161 }
162
163 double step = (fast_uniform() - 0.5) * 2.0 * step_size;
164 m_state.current_value += step;
165 m_state.current_value = std::clamp(m_state.current_value, min, max);
166
168 return m_state.current_value;
169}
std::optional< std::any > get_config(const std::string &key) const
Gets configuration parameter.

References MayaFlux::Kinesis::Stochastic::GeneratorState::current_value, fast_uniform(), get_config(), m_state, and MayaFlux::Kinesis::Stochastic::GeneratorState::step_count.

Referenced by operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: