pub struct WeightedTable {
pub values: Vec<String>,
pub cumulative: Vec<f64>,
}Expand description
Pre-parsed value table for one_of_weighted. The cumulative
vector is normalised so the last entry is exactly 1.0, letting
the eval body locate the matching bucket with a single binary
search.
Fields§
§values: Vec<String>Output values in declaration order.
cumulative: Vec<f64>Cumulative weights, normalised to [0.0, 1.0]. The last entry is always 1.0.
Implementations§
Trait Implementations§
impl PolydatSetup for WeightedTable
Auto Trait Implementations§
impl Freeze for WeightedTable
impl RefUnwindSafe for WeightedTable
impl Send for WeightedTable
impl Sync for WeightedTable
impl Unpin for WeightedTable
impl UnsafeUnpin for WeightedTable
impl UnwindSafe for WeightedTable
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