Genetics basics
This commit is contained in:
parent
6f62876db3
commit
964a8c49ad
2 changed files with 22 additions and 0 deletions
21
rust-pvz-genetics/src/genetics/mod.rs
Normal file
21
rust-pvz-genetics/src/genetics/mod.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
#[derive(Clone,Copy,PartialEq,Eq)]
|
||||||
|
pub struct GeneID;
|
||||||
|
|
||||||
|
pub trait Gene {}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
pub struct PlantGenome {
|
||||||
|
pub edges: HashMap<GeneID,Vec<GeneID>>,
|
||||||
|
pub vertices: HashMap<GeneID,Box<dyn Gene>>
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PlantGenome {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self {
|
||||||
|
edges: HashMap::new(),
|
||||||
|
vertices: HashMap::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
pub mod genetics;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue