pub struct SupportLevelTable<V> {
pub levels: Vec<V>,
pub indexes_by_level: Vec<usize>,
}Fields§
§levels: Vec<V>vector index === agent_idx
indexes_by_level: Vec<usize>sorted in descending order by level
Implementations§
Source§impl<V: MyFloat> SupportLevelTable<V>
impl<V: MyFloat> SupportLevelTable<V>
pub fn level(&self, idx: usize) -> V
pub fn random<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<usize>
pub fn top<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<usize>
pub fn middle<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<usize>where
V: MyFloat,
pub fn bottom<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<usize>
Auto Trait Implementations§
impl<V> Freeze for SupportLevelTable<V>
impl<V> RefUnwindSafe for SupportLevelTable<V>where
V: RefUnwindSafe,
impl<V> Send for SupportLevelTable<V>where
V: Send,
impl<V> Sync for SupportLevelTable<V>where
V: Sync,
impl<V> Unpin for SupportLevelTable<V>where
V: Unpin,
impl<V> UnwindSafe for SupportLevelTable<V>where
V: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more