pub struct Graph<T>{
pub nodes: Vec<Node<T>>,
}Fields§
§nodes: Vec<Node<T>>Implementations§
Trait Implementations§
Source§impl<T> Codex<NodeChromosome<T>, Graph<T>> for GraphCodex<T>
impl<T> Codex<NodeChromosome<T>, Graph<T>> for GraphCodex<T>
fn encode(&self) -> Genotype<NodeChromosome<T>>
fn decode(&self, genotype: &Genotype<NodeChromosome<T>>) -> Graph<T>
Source§fn spawn(&self, num: usize) -> Vec<T>
fn spawn(&self, num: usize) -> Vec<T>
Spawn a new instance of
T from the Codex. This will encode num new Genotypes and then
decode it to a new instance of T.Source§fn spawn_genotypes(&self, num: usize) -> Vec<Genotype<C>>
fn spawn_genotypes(&self, num: usize) -> Vec<Genotype<C>>
Spawn a new instance of
Genotype<G, A> from the Codex. This will encode num a new Genotypes.Source§fn spawn_population(&self, num: usize) -> Population<C>
fn spawn_population(&self, num: usize) -> Population<C>
Spawn a new instance of
Population<G, A> from the Codex. This will encode num a new GenotypesSource§impl<T> IntoIterator for Graph<T>
impl<T> IntoIterator for Graph<T>
Source§impl<T> NodeCollection<T> for Graph<T>
impl<T> NodeCollection<T> for Graph<T>
fn from_nodes(nodes: Vec<Node<T>>) -> Self
fn get(&self, index: usize) -> &Node<T>
fn get_mut(&mut self, index: usize) -> &mut Node<T>
fn get_nodes(&self) -> &[Node<T>]
fn get_nodes_mut(&mut self) -> &mut [Node<T>]
fn set(&mut self, index: usize, node: Node<T>) -> &mut Self
fn iter(&self) -> Iter<'_, Node<T>>
fn iter_mut(&mut self) -> IterMut<'_, Node<T>>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn attach(&mut self, incoming: usize, outgoing: usize) -> &mut Self
fn detach(&mut self, incoming: usize, outgoing: usize) -> &mut Self
Source§impl<T> NodeRepairs<T> for Graph<T>
impl<T> NodeRepairs<T> for Graph<T>
fn repair(&mut self, factory: Option<&NodeFactory<T>>) -> Self
impl<T> StructuralPartialEq for Graph<T>
Auto Trait Implementations§
impl<T> Freeze for Graph<T>
impl<T> !RefUnwindSafe for Graph<T>
impl<T> !Send for Graph<T>
impl<T> !Sync for Graph<T>
impl<T> Unpin for Graph<T>where
T: Unpin,
impl<T> !UnwindSafe for Graph<T>
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> 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