pub struct Cppn<'a, N, L, EXTID>where
N: CppnNodeType + 'a,
L: Copy + Debug + Send + Sized + Into<f64> + 'a,
EXTID: Copy + Debug + Send + Sized + Ord + 'a,{ /* private fields */ }Expand description
Represents a Compositional Pattern Producing Network (CPPN)
Implementations§
Source§impl<'a, N, L, EXTID> Cppn<'a, N, L, EXTID>
impl<'a, N, L, EXTID> Cppn<'a, N, L, EXTID>
pub fn new(graph: &'a CppnGraph<N, L, EXTID>) -> Cppn<'a, N, L, EXTID>
pub fn incoming_signals(&self) -> &[f64]
Sourcepub fn read_output(&self, nth_output: usize) -> Option<f64>
pub fn read_output(&self, nth_output: usize) -> Option<f64>
Reads the nth_output of the network.
Sourcepub fn output_count(&self) -> usize
pub fn output_count(&self) -> usize
Returns the number of outputs
Sourcepub fn input_count(&self) -> usize
pub fn input_count(&self) -> usize
Returns the number of inputs
Sourcepub fn process(&mut self, inputs: &[&[f64]])
pub fn process(&mut self, inputs: &[&[f64]])
Process the network for the given inputs. Outputs can be read after this call using
read_output.
Sourcepub fn group_layers(&self) -> Vec<Vec<usize>>
pub fn group_layers(&self) -> Vec<Vec<usize>>
Group the nodes into layers.
pub fn layout(&self) -> Vec<usize>
Auto Trait Implementations§
impl<'a, N, L, EXTID> Freeze for Cppn<'a, N, L, EXTID>
impl<'a, N, L, EXTID> RefUnwindSafe for Cppn<'a, N, L, EXTID>
impl<'a, N, L, EXTID> Send for Cppn<'a, N, L, EXTID>
impl<'a, N, L, EXTID> Sync for Cppn<'a, N, L, EXTID>
impl<'a, N, L, EXTID> Unpin for Cppn<'a, N, L, EXTID>
impl<'a, N, L, EXTID> UnwindSafe for Cppn<'a, N, L, EXTID>
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