Struct rustneat::Gene
[−]
[src]
pub struct Gene { /* fields omitted */ }
A connection Gene
Methods
impl Gene
[src]
pub fn new(
in_neuron_id: usize,
out_neuron_id: usize,
weight: f64,
enabled: bool
) -> Gene
[src]
in_neuron_id: usize,
out_neuron_id: usize,
weight: f64,
enabled: bool
) -> Gene
Create a new gene
pub fn generate_weight() -> f64
[src]
Generate a weight
pub fn in_neuron_id(&self) -> usize
[src]
Connection in ->
pub fn out_neuron_id(&self) -> usize
[src]
connection out <->
pub fn weight(&self) -> f64
[src]
getter for the wight of the gene
pub fn set_weight(&mut self, weight: f64)
[src]
Setter
pub fn enabled(&self) -> bool
[src]
Is gene enabled
pub fn set_enabled(&mut self)
[src]
Set gene enabled
pub fn set_disabled(&mut self)
[src]
Set gene disabled
Trait Implementations
impl Debug for Gene
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Gene
[src]
impl Clone for Gene
[src]
fn clone(&self) -> Gene
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Gene
[src]
impl PartialEq for Gene
[src]
fn eq(&self, other: &Gene) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Ord for Gene
[src]
fn cmp(&self, other: &Gene) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for Gene
[src]
fn partial_cmp(&self, other: &Gene) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more