pub enum Model {
ER {
p: f64,
whole: bool,
},
BA {
m0: usize,
m: usize,
},
Custom(String),
None,
}Expand description
Decides the algorithm used to connect the nodes during Network’s initialization. It can
also be used for identification purposes when the Model::Custom variant is used.
Variants§
ER
The Erdos–Renyi random network model.
Fields
BA
The Barabasi–Albert preferential attachment model.
Fields
Custom(String)
Custom model, can be dynamically assigned to a network using Network::set_model.
None
Placeholder for a network with no specified model. When a network is initialized with this model no immediate connections will be made.
Implementations§
Source§impl Model
impl Model
Sourcepub fn init_er(net: &mut Network, p: f64, whole: bool)
pub fn init_er(net: &mut Network, p: f64, whole: bool)
Clear the network’s links and reinitialize them according to the Erdos-Renyi model.
See Model::ER for more detailed explanation.
Sourcepub fn init_ba(net: &mut Network, m0: usize, m: usize)
pub fn init_ba(net: &mut Network, m0: usize, m: usize)
Clear the network’s links and reinitialize them according to the Barabasi-Albert model.
See Model::BA for more detailed model explanation.
pub fn as_str(&self) -> &str
Trait Implementations§
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.