MayaFlux 0.4.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 159 of file Stochastic.cpp.

160{
161 double step_size = 0.01;
162 if (auto cfg = get_config("step_size"); cfg.has_value()) {
163 step_size = std::any_cast<double>(*cfg);
164 }
165
166 double step = (fast_uniform() - 0.5) * 2.0 * step_size;
167 m_state.current_value += step;
168 m_state.current_value = std::clamp(m_state.current_value, min, max);
169
171 return m_state.current_value;
172}
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: