pub struct Demographics {
groups: GroupMapWrapper,
}
Fields§
§groups: GroupMapWrapper
Implementations§
Source§impl Demographics
impl Demographics
pub fn new(groups: HashMap<(Species, Ethnicity), u64>) -> Self
pub fn shift_species(&self, species: &Species, amount: f64) -> Self
pub fn only_species(&self, species: &Species) -> Self
pub fn shift_ethnicity(&self, ethnicity: &Ethnicity, amount: f64) -> Self
pub fn only_ethnicity(&self, ethnicity: &Ethnicity) -> Self
pub fn shift_species_ethnicity( &self, species: &Species, ethnicity: &Ethnicity, amount: f64, ) -> Self
pub fn only_species_ethnicity( &self, species: &Species, ethnicity: &Ethnicity, ) -> Self
pub fn gen_species_ethnicity(&self, rng: &mut impl Rng) -> (Species, Ethnicity)
fn shift_by<F: Fn(&Species, &Ethnicity) -> bool>( &self, f: F, amount: f64, default: (Species, Ethnicity), ) -> Self
fn groups(&self) -> &HashMap<(Species, Ethnicity), u64>
Trait Implementations§
Source§impl Clone for Demographics
impl Clone for Demographics
Source§fn clone(&self) -> Demographics
fn clone(&self) -> Demographics
Returns a copy 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 Demographics
impl Debug for Demographics
Source§impl Default for Demographics
impl Default for Demographics
Source§impl<'de> Deserialize<'de> for Demographics
impl<'de> Deserialize<'de> for Demographics
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
Source§impl PartialEq for Demographics
impl PartialEq for Demographics
Source§impl Serialize for Demographics
impl Serialize for Demographics
impl Eq for Demographics
impl StructuralPartialEq for Demographics
Auto Trait Implementations§
impl Freeze for Demographics
impl RefUnwindSafe for Demographics
impl Send for Demographics
impl Sync for Demographics
impl Unpin for Demographics
impl UnwindSafe for Demographics
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