Pair manipulations

This commit is contained in:
rendo 2026-03-31 16:19:44 +05:00
commit edb5ed4b1e
4 changed files with 59 additions and 30 deletions

View file

@ -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())];