Dummy renamed to structural

This commit is contained in:
rendo 2026-04-01 10:59:14 +05:00
commit 38218ee1a4
4 changed files with 10 additions and 10 deletions

View file

@ -26,7 +26,7 @@ Gene structure consists of variables specific to gene, type and overridable meth
Type of gene is enum that provides different functions. Here is (Very WIP) list of every type and its provided functions: Type of gene is enum that provides different functions. Here is (Very WIP) list of every type and its provided functions:
Dummy - gene without behaviour. Structural - gene without behaviour.
Transport - gene that defines rules of flow. Transport - gene that defines rules of flow.
- `distribute_between_children(<context>) -> ChildDistribution` - `distribute_between_children(<context>) -> ChildDistribution`

View file

@ -25,7 +25,7 @@ pub enum GeneSource {
#[derive(PartialEq,Eq,Clone)] #[derive(PartialEq,Eq,Clone)]
pub enum GeneType { pub enum GeneType {
/// Without functional behaviour. Doesn't pass through flow. /// Without functional behaviour. Doesn't pass through flow.
Dummy, Structural,
/// Only creates flow. Can be set up to not create flow if flow isn't empty. /// Only creates flow. Can be set up to not create flow if flow isn't empty.
PureProducer { PureProducer {
create_flow: fn(GeneContext) -> Flow create_flow: fn(GeneContext) -> Flow

View file

@ -17,8 +17,8 @@ pub fn peashooter_template() -> Genome {
pub fn sunflower_template() -> Genome { pub fn sunflower_template() -> Genome {
Genome::from_edges(vec![ Genome::from_edges(vec![
Gene::new(GeneSource::Sunflower,"root", GeneType::Dummy), Gene::new(GeneSource::Sunflower,"root", GeneType::Structural),
Gene::new(GeneSource::Sunflower,"stem", GeneType::Dummy), Gene::new(GeneSource::Sunflower,"stem", GeneType::Structural),
Gene::new(GeneSource::Sunflower,"head", GeneType::modifier(|_|{Flow::empty()})), Gene::new(GeneSource::Sunflower,"head", GeneType::modifier(|_|{Flow::empty()})),
Gene::new(GeneSource::Sunflower,"face", GeneType::consumer(|_|{})), Gene::new(GeneSource::Sunflower,"face", GeneType::consumer(|_|{})),
], vec![ ], vec![
@ -33,8 +33,8 @@ pub fn cherry_bomb_template() -> Genome {
Gene::new(GeneSource::CherryBomb,"root", GeneType::modifier(|_|{Flow::empty()})), Gene::new(GeneSource::CherryBomb,"root", GeneType::modifier(|_|{Flow::empty()})),
Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})), Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})),
Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})), Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})),
Gene::new(GeneSource::CherryBomb,"face", GeneType::Dummy), Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
Gene::new(GeneSource::CherryBomb,"face", GeneType::Dummy), Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
], vec![ ], vec![
(0,1), (0,1),
(0,2), (0,2),

View file

@ -21,7 +21,7 @@ fn test_allelic_crossingover() {
println!("Sunflower:\n{}",sunflower); println!("Sunflower:\n{}",sunflower);
assert!(peashooter.to_string() == Genome::from_edges(vec![ assert!(peashooter.to_string() == Genome::from_edges(vec![
Gene::new(GeneSource::Sunflower,"root", GeneType::Dummy), Gene::new(GeneSource::Sunflower,"root", GeneType::Structural),
Gene::new(GeneSource::Peashooter,"stem", GeneType::fill_all()), Gene::new(GeneSource::Peashooter,"stem", GeneType::fill_all()),
Gene::new(GeneSource::Peashooter,"head",GeneType::random_distribution()), Gene::new(GeneSource::Peashooter,"head",GeneType::random_distribution()),
Gene::new(GeneSource::Sunflower,"face", GeneType::consumer(|_|{})), Gene::new(GeneSource::Sunflower,"face", GeneType::consumer(|_|{})),
@ -35,7 +35,7 @@ fn test_allelic_crossingover() {
assert!(sunflower.to_string() == Genome::from_edges(vec![ assert!(sunflower.to_string() == Genome::from_edges(vec![
Gene::new(GeneSource::Peashooter,"root", GeneType::pure_producer(|_|{Flow::empty()})), Gene::new(GeneSource::Peashooter,"root", GeneType::pure_producer(|_|{Flow::empty()})),
Gene::new(GeneSource::Sunflower,"stem", GeneType::Dummy), Gene::new(GeneSource::Sunflower,"stem", GeneType::Structural),
Gene::new(GeneSource::Sunflower,"head", GeneType::modifier(|_|{Flow::empty()})), Gene::new(GeneSource::Sunflower,"head", GeneType::modifier(|_|{Flow::empty()})),
Gene::new(GeneSource::Peashooter,"leaf",GeneType::modifier(|_|{Flow::empty()})), Gene::new(GeneSource::Peashooter,"leaf",GeneType::modifier(|_|{Flow::empty()})),
], vec![ ], vec![
@ -63,7 +63,7 @@ fn test_categoric_crossingover() {
Gene::new(GeneSource::Peashooter,"stem", GeneType::fill_all()), Gene::new(GeneSource::Peashooter,"stem", GeneType::fill_all()),
Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})), Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})),
Gene::new(GeneSource::Peashooter,"leaf",GeneType::modifier(|_|{Flow::empty()})), Gene::new(GeneSource::Peashooter,"leaf",GeneType::modifier(|_|{Flow::empty()})),
Gene::new(GeneSource::CherryBomb,"face", GeneType::Dummy), Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
],vec![ ],vec![
(0,1), (0,1),
(1,2), (1,2),
@ -75,7 +75,7 @@ fn test_categoric_crossingover() {
Gene::new(GeneSource::Peashooter,"root", GeneType::pure_producer(|_|{Flow::empty()})), Gene::new(GeneSource::Peashooter,"root", GeneType::pure_producer(|_|{Flow::empty()})),
Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})), Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})),
Gene::new(GeneSource::Peashooter,"head",GeneType::random_distribution()), Gene::new(GeneSource::Peashooter,"head",GeneType::random_distribution()),
Gene::new(GeneSource::CherryBomb,"face", GeneType::Dummy), Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
Gene::new(GeneSource::Peashooter,"face",GeneType::consumer(|_|{})), Gene::new(GeneSource::Peashooter,"face",GeneType::consumer(|_|{})),
], vec![ ], vec![
(0,1), (0,1),