Pair manipulations
This commit is contained in:
parent
a355cd4d55
commit
edb5ed4b1e
4 changed files with 59 additions and 30 deletions
|
|
@ -2,12 +2,12 @@ use std::{collections::VecDeque, fmt::Display};
|
|||
|
||||
use crate::genetics::gene::Gene;
|
||||
|
||||
#[derive(PartialEq,Eq)]
|
||||
pub struct PlantGenome {
|
||||
#[derive(Clone,PartialEq,Eq)]
|
||||
pub struct Genome {
|
||||
pub(crate) graph: Vec<(Gene,Vec<usize>)>,
|
||||
}
|
||||
|
||||
impl PlantGenome {
|
||||
impl Genome {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
graph: Vec::new()
|
||||
|
|
@ -33,7 +33,7 @@ impl PlantGenome {
|
|||
}
|
||||
}
|
||||
|
||||
impl Display for PlantGenome {
|
||||
impl Display for Genome {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let indents = {
|
||||
let mut result: Vec<(usize,Gene)> = vec![(0,self.graph[0].0.clone())];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue