pub struct TimingModel {
pub long: Vec<LongModel>,
pub windows: Vec<usize>,
pub tables: Vec<Vec<LowTable>>,
pub unconditional: Vec<LowTable>,
pub exit_tables: Vec<Vec<LowTable>>,
pub exit_unconditional: Vec<LowTable>,
pub min_rows: usize,
pub fitted_on: String,
}Expand description
Everything the timing indicator needs at run time. Produced by
sd_timing research and embedded from timing_model.json.
Fields§
§long: Vec<LongModel>One per LONG_HORIZONS.
windows: Vec<usize>§tables: Vec<Vec<LowTable>>tables[window][bucket], 30 buckets (3 states × 10 deciles).
unconditional: Vec<LowTable>unconditional[window]: the same table ignoring SD (the fallback,
and the baseline SD has to beat).
exit_tables: Vec<Vec<LowTable>>The exit mirror: quantiles of z_max (highest high), same layout.
exit_unconditional: Vec<LowTable>§min_rows: usizeBuckets with fewer rows than this fall back to unconditional.
fitted_on: StringImplementations§
Source§impl TimingModel
impl TimingModel
pub fn embedded() -> Self
Sourcepub fn exit_table(&self, w: usize, bucket: usize) -> &LowTable
pub fn exit_table(&self, w: usize, bucket: usize) -> &LowTable
The exit table for a window index and bucket (falls back when thin).
Sourcepub fn table(&self, w: usize, bucket: usize) -> &LowTable
pub fn table(&self, w: usize, bucket: usize) -> &LowTable
The table for a window index and bucket (falls back when thin).
Source§impl TimingModel
impl TimingModel
Sourcepub fn exit_plan(
&self,
r: &Sd2Reading,
cfg: &TimingConfig,
sell: bool,
) -> ExitPlan
pub fn exit_plan( &self, r: &Sd2Reading, cfg: &TimingConfig, sell: bool, ) -> ExitPlan
Choose how to sell, given today’s reading and whether the verdict is sell.
Trait Implementations§
Source§impl Clone for TimingModel
impl Clone for TimingModel
Source§fn clone(&self) -> TimingModel
fn clone(&self) -> TimingModel
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 TimingModel
impl Debug for TimingModel
Source§impl<'de> Deserialize<'de> for TimingModel
impl<'de> Deserialize<'de> for TimingModel
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 TimingModel
impl RefUnwindSafe for TimingModel
impl Send for TimingModel
impl Sync for TimingModel
impl Unpin for TimingModel
impl UnsafeUnpin for TimingModel
impl UnwindSafe for TimingModel
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