Skip to content

Add a second, modernised evolvable genotype (non-byte-code design) #6

Description

@gilesknap

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions