Dummy renamed to structural
This commit is contained in:
parent
e53c36fd41
commit
38218ee1a4
4 changed files with 10 additions and 10 deletions
|
|
@ -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:
|
||||
|
||||
Dummy - gene without behaviour.
|
||||
Structural - gene without behaviour.
|
||||
|
||||
Transport - gene that defines rules of flow.
|
||||
- `distribute_between_children(<context>) -> ChildDistribution`
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub enum GeneSource {
|
|||
#[derive(PartialEq,Eq,Clone)]
|
||||
pub enum GeneType {
|
||||
/// 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.
|
||||
PureProducer {
|
||||
create_flow: fn(GeneContext) -> Flow
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ pub fn peashooter_template() -> Genome {
|
|||
|
||||
pub fn sunflower_template() -> Genome {
|
||||
Genome::from_edges(vec![
|
||||
Gene::new(GeneSource::Sunflower,"root", GeneType::Dummy),
|
||||
Gene::new(GeneSource::Sunflower,"stem", GeneType::Dummy),
|
||||
Gene::new(GeneSource::Sunflower,"root", GeneType::Structural),
|
||||
Gene::new(GeneSource::Sunflower,"stem", GeneType::Structural),
|
||||
Gene::new(GeneSource::Sunflower,"head", GeneType::modifier(|_|{Flow::empty()})),
|
||||
Gene::new(GeneSource::Sunflower,"face", GeneType::consumer(|_|{})),
|
||||
], vec![
|
||||
|
|
@ -33,8 +33,8 @@ pub fn cherry_bomb_template() -> Genome {
|
|||
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,"face", GeneType::Dummy),
|
||||
Gene::new(GeneSource::CherryBomb,"face", GeneType::Dummy),
|
||||
Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
|
||||
Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
|
||||
], vec![
|
||||
(0,1),
|
||||
(0,2),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fn test_allelic_crossingover() {
|
|||
println!("Sunflower:\n{}",sunflower);
|
||||
|
||||
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,"head",GeneType::random_distribution()),
|
||||
Gene::new(GeneSource::Sunflower,"face", GeneType::consumer(|_|{})),
|
||||
|
|
@ -35,7 +35,7 @@ fn test_allelic_crossingover() {
|
|||
|
||||
assert!(sunflower.to_string() == Genome::from_edges(vec![
|
||||
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::Peashooter,"leaf",GeneType::modifier(|_|{Flow::empty()})),
|
||||
], vec![
|
||||
|
|
@ -63,7 +63,7 @@ fn test_categoric_crossingover() {
|
|||
Gene::new(GeneSource::Peashooter,"stem", GeneType::fill_all()),
|
||||
Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})),
|
||||
Gene::new(GeneSource::Peashooter,"leaf",GeneType::modifier(|_|{Flow::empty()})),
|
||||
Gene::new(GeneSource::CherryBomb,"face", GeneType::Dummy),
|
||||
Gene::new(GeneSource::CherryBomb,"face", GeneType::Structural),
|
||||
],vec![
|
||||
(0,1),
|
||||
(1,2),
|
||||
|
|
@ -75,7 +75,7 @@ fn test_categoric_crossingover() {
|
|||
Gene::new(GeneSource::Peashooter,"root", GeneType::pure_producer(|_|{Flow::empty()})),
|
||||
Gene::new(GeneSource::CherryBomb,"head", GeneType::consumer(|_|{})),
|
||||
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(|_|{})),
|
||||
], vec![
|
||||
(0,1),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue