Background
PR #5 added the giles genotype — a faithful port of the original 1999 RISC byte-code genome (a 1000-byte program interpreted by a 12-instruction VM, evolving via per-byte mutation + copy-point splicing on reproduction).
When scoping that work we decided to keep giles faithful to the original and open this issue to add a second, modernised evolvable genotype later, so the two designs can co-exist and compete (the plugin architecture explicitly supports multiple genome types).
Goal
Implement an additional Genotype plugin that keeps the spirit of the original (a mutable, heritable genome that drives behaviour, with mutation on reproduction) but uses a cleaner, more Rust-idiomatic representation than a raw byte-code interpreter. Candidate designs:
- Weighted stimulus → action table: map perceived state (the 8
Look cells, energy band, etc.) to a probability distribution over actions (move directions / reproduce / rest), with the weights being the evolvable genome.
- Tiny feed-forward neural net: small fixed-topology network, weights as the genome, mutated with Gaussian noise on reproduction.
- Decision-tree / rule-list genome.
A weighted stimulus→action table is probably the most approachable and is the suggested starting point.
Suggested scope
- New file under
eyes2-lib/src/entity/genotype/genotypes/ (copy the structure of giles.rs / random.rs).
- Register it in
new_genotype() (eyes2-lib/src/entity/genotype/genotype.rs) and add it to the default settings creature list (eyes2-lib/src/settings.rs).
- Reuse the existing single-cell
Look vision (same constraint giles uses).
- Unit tests for the genome/mutation, plus optionally extend
eyes2-lib/tests/evolution.rs to pit it against giles and compare survival/population over time.
- Update
README.md "How to add a new Genotype" if the process reveals anything worth noting.
References
giles implementation (worked example): eyes2-lib/src/entity/genotype/genotypes/giles.rs
- The
Genotype trait / GenotypeActions: eyes2-lib/src/entity/genotype/genotype.rs
- Original C++ for inspiration: https://github.com/gilesknap/eyes
Relates to the "Get some competing Genotype contributions and have some creature wars" item in the README's still-to-do list.
Background
PR #5 added the
gilesgenotype — a faithful port of the original 1999 RISC byte-code genome (a 1000-byte program interpreted by a 12-instruction VM, evolving via per-byte mutation + copy-point splicing on reproduction).When scoping that work we decided to keep
gilesfaithful to the original and open this issue to add a second, modernised evolvable genotype later, so the two designs can co-exist and compete (the plugin architecture explicitly supports multiple genome types).Goal
Implement an additional
Genotypeplugin that keeps the spirit of the original (a mutable, heritable genome that drives behaviour, with mutation on reproduction) but uses a cleaner, more Rust-idiomatic representation than a raw byte-code interpreter. Candidate designs:Lookcells, energy band, etc.) to a probability distribution over actions (move directions / reproduce / rest), with the weights being the evolvable genome.A weighted stimulus→action table is probably the most approachable and is the suggested starting point.
Suggested scope
eyes2-lib/src/entity/genotype/genotypes/(copy the structure ofgiles.rs/random.rs).new_genotype()(eyes2-lib/src/entity/genotype/genotype.rs) and add it to the default settings creature list (eyes2-lib/src/settings.rs).Lookvision (same constraintgilesuses).eyes2-lib/tests/evolution.rsto pit it againstgilesand compare survival/population over time.README.md"How to add a new Genotype" if the process reveals anything worth noting.References
gilesimplementation (worked example):eyes2-lib/src/entity/genotype/genotypes/giles.rsGenotypetrait /GenotypeActions:eyes2-lib/src/entity/genotype/genotype.rsRelates to the "Get some competing Genotype contributions and have some creature wars" item in the README's still-to-do list.