How benmmari/genetic-algorithm-example works
Project type and purpose
• This is a Ruby‐based console application whose sole purpose is to demonstrate how a genetic algorithm evolves a population of candidate “solutions” (organisms) toward a target string. It is not a web or UI‐driven system but rather a self-contained simulation tool.
File structure
• Top‐level files:
• Gemfile/Gemfile.lock – Ruby dependencies
• README.md – project overview and instructions
• .github/workflows/ruby.yml – CI pipeline to run tests
• Directories:
• console/ – entry points and orchestration (main.rb, simulation.rb)
• models/ – core domain objects: Gene, Chromosome, Organism, Environment
• spec/ – RSpec tests mirroring model structure
README for additional insights
• Describes the genetic algorithm steps: initialization, fitness sorting, culling, mating (chromosome exchange), mutation, and termination when an organism matches the target.
• Specifies inputs: population capacity, initial size, solution string, generations to print.