pub struct Pattern {
pub id: String,
pub factors: Vec<f64>,
}Expand description
A repeating sequence of dimensionless multipliers (§2.2). Static.
Fields§
§id: StringString identifier for this pattern.
factors: Vec<f64>Multipliers [F₀, F₁, …, F_{L−1}]. Length ≥ 1.
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn eval(&self, t: f64, pattern_step: f64, pattern_start: f64) -> f64
pub fn eval(&self, t: f64, pattern_step: f64, pattern_start: f64) -> f64
Returns the multiplier active at simulation time t (seconds).
Implements §2.2: $p = \lfloor (t + t_{\text{start}}) / \Delta t_p \rfloor$, active multiplier = $F[p \bmod L]$.
pattern_step and pattern_start come from SimulationOptions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more