Struct net_ensembles::BAensemble [−][src]
Expand description
Implements a Barabási-Albert Graph ensemble
Implementations
Initialize
- create simplest form of Barabási-Albert graph
m
= 1n
: Number of nodes,n > 1
has to be true panics otherwiserng
: Rng to use
Generate a new BA graph ensemble with a specified source graph
- panics if
source_graph
contains any vertices with degree 0 m
: how many edges should each newly added vertex have originallyrng
: Random number generatorn
: Number of nodes,n > source_graph.vertex_count()
has to be true panics otherwise
pub fn new_from_generic_graph<A2, B>(
n: usize,
rng: R,
m: usize,
generic_source_graph: B
) -> Self where
A2: AdjContainer<T>,
B: Borrow<GenericGraph<T, A2>>,
pub fn new_from_generic_graph<A2, B>(
n: usize,
rng: R,
m: usize,
generic_source_graph: B
) -> Self where
A2: AdjContainer<T>,
B: Borrow<GenericGraph<T, A2>>,
Generate a new BA graph ensemble with a specified generic source graph
- panics if
generic_source_graph
contains any vertices with degree 0 m
: how many edges should each newly added vertex have originallyrng
: Random number generatorn
: Number of nodes,n > source_graph.vertex_count()
has to be true panics otherwise
get reference to original graph, which is at the core of the BA graph
Trait Implementations
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node,
R: Rng,
impl<'de, T, R> Deserialize<'de> for BAensemble<T, R> where
T: Node,
R: Rng,
T: Deserialize<'de>,
R: Deserialize<'de>,
impl<'de, T, R> Deserialize<'de> for BAensemble<T, R> where
T: Node,
R: Rng,
T: Deserialize<'de>,
R: Deserialize<'de>,
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
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_neighbors_mut(
&mut self,
index: usize
) -> NContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for NContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Notable traits for NContainedIterMut<'a, T, A>
impl<'a, T, A> Iterator for NContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
index
&mut T
sort_adj
will affect the orderfn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
fn contained_iter_neighbors_mut_with_index(
&mut self,
index: usize
) -> INContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for INContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
Notable traits for INContainedIterMut<'a, T, A>
impl<'a, T, A> Iterator for INContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = (usize, &'a mut T);
index
(index_neighbor: usize, neighbor: &mut T)
sort_adj
will affect the orderfn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>ⓘNotable traits for ContainedIterMut<'a, T, A>impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Notable traits for ContainedIterMut<'a, T, A>
impl<'a, T, A> Iterator for ContainedIterMut<'a, T, A> where
T: 'a + Node,
A: AdjContainer<T>, type Item = &'a mut T;
Node
(for example EmptyNode
or whatever you used)Randomizes the Barabási-Albert (BA) graph
- this essentially deletes the BA graph and creates a new one using the initial graph
do the following times
times: Read more
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R> where
T: Node + SerdeStateConform,
R: Rng,
GenericGraph
Auto Trait Implementations
impl<T, R> RefUnwindSafe for BAensemble<T, R> where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, R> Send for BAensemble<T, R> where
R: Send,
T: Send,
impl<T, R> Sync for BAensemble<T, R> where
R: Sync,
T: Sync,
impl<T, R> Unpin for BAensemble<T, R> where
R: Unpin,
T: Unpin,
impl<T, R> UnwindSafe for BAensemble<T, R> where
R: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more