pub enum PeriodEndModel {
FlatMultiplier {
multiplier: f64,
},
ExponentialAcceleration {
start_day: i32,
base_multiplier: f64,
peak_multiplier: f64,
decay_rate: f64,
},
DailyProfile {
profile: HashMap<i32, f64>,
interpolation: InterpolationMethod,
},
ExtendedCrunch {
start_day: i32,
sustained_high_days: i32,
peak_multiplier: f64,
ramp_up_days: i32,
},
}Expand description
Model for period-end volume patterns.
Variants§
FlatMultiplier
Simple flat multiplier (legacy behavior).
ExponentialAcceleration
Exponential acceleration curve approaching period end.
Fields
DailyProfile
Custom daily profile with explicit multipliers.
Fields
§
interpolation: InterpolationMethodInterpolation method for days not in profile
ExtendedCrunch
Extended crunch period with sustained high volume.
Implementations§
Source§impl PeriodEndModel
impl PeriodEndModel
Sourcepub fn get_multiplier(&self, days_to_end: i32) -> f64
pub fn get_multiplier(&self, days_to_end: i32) -> f64
Calculate the multiplier for a given number of days to period end.
days_to_end is negative or zero (0 = last day, -1 = day before, etc.)
Sourcepub fn exponential_accounting() -> Self
pub fn exponential_accounting() -> Self
Create an exponential acceleration model with typical accounting close parameters.
Sourcepub fn custom_profile(profile: HashMap<i32, f64>) -> Self
pub fn custom_profile(profile: HashMap<i32, f64>) -> Self
Create a custom daily profile.
Trait Implementations§
Source§impl Clone for PeriodEndModel
impl Clone for PeriodEndModel
Source§fn clone(&self) -> PeriodEndModel
fn clone(&self) -> PeriodEndModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PeriodEndModel
impl Debug for PeriodEndModel
Source§impl Default for PeriodEndModel
impl Default for PeriodEndModel
Source§impl<'de> Deserialize<'de> for PeriodEndModel
impl<'de> Deserialize<'de> for PeriodEndModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PeriodEndModel
impl RefUnwindSafe for PeriodEndModel
impl Send for PeriodEndModel
impl Sync for PeriodEndModel
impl Unpin for PeriodEndModel
impl UnwindSafe for PeriodEndModel
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