Skip to content

1.0.7

Latest

Choose a tag to compare

@AlexanderGatesDev AlexanderGatesDev released this 09 Jan 01:16

BiosimRust v1.0.7

New Features

NEAT-Style Speciation

  • Added speciationenabled parameter to enable/disable speciation system
  • Implements NEAT (NeuroEvolution of Augmenting Topologies) compatibility distance algorithm
  • Groups organisms into species based on genetic similarity to protect innovative structures
  • Allows large genomes from duplication events to compete within their species rather than being outcompeted by lean ancestors
  • Includes species stagnation tracking and automatic extinction of non-improving species
  • Implements fitness sharing to prevent large species from dominating selection

Enhanced Epoch Logging

  • Extended epoch log format to include species statistics when speciation is enabled
  • New format: generation survivors diversity avg_genome_length murder_count num_species avg_species_size largest_species smallest_species new_species extinct_species avg_species_age avg_stagnation
  • Backward compatible: falls back to 5-column format when speciation is disabled
  • Enables detailed analysis of species dynamics over time

New Visualization Tools

  • Added graphlog-species.gp for visualizing species count alongside population metrics
  • Added graphlog-species-detailed.gp for comprehensive multi-panel species analysis
  • Both tools gracefully handle missing species statistics for backward compatibility

Configuration

New parameters in biosimrust.ini:

Speciation Control

  • speciationenabled - Enable/disable speciation system (true/false). Default: false
    • When enabled, organisms are grouped into species based on genetic compatibility
    • Protects innovative genome structures from premature elimination

Compatibility Distance Parameters

  • compatibilitythreshold - Maximum genetic distance for same species (0.1-100.0). Default: 3.0

    • Lower values create more species (more diversity protection)
    • Higher values create fewer species (less diversity protection)
    • Recommended: 1.5-2.5 for balanced speciation
    • Formula: δ = (c1E/N) + (c2D/N) + (c3*W) where E=excess, D=disjoint, W=weight diff, N=longer genome
    • Based on NEAT algorithm
  • excesscoefficient - Weight for excess genes in compatibility distance (0.0-10.0). Default: 1.0

  • disjointcoefficient - Weight for disjoint genes in compatibility distance (0.0-10.0). Default: 1.0

  • weightcoefficient - Weight for average weight difference in compatibility distance (0.0-10.0). Default: 0.4

Species Management Parameters

  • speciesstagnationthreshold - Generations without improvement before species extinction (1-1000). Default: 15

    • Higher values allow species to persist longer without improvement
    • Lower values more aggressively cull stagnant species
  • minspeciessize - Minimum members required to keep species alive (1-100). Default: 1

    • Allows small innovative species to survive
  • maxspeciessize - Maximum members per species, enforced by culling (1-10000). Default: 50

    • Prevents single species from dominating population
    • Recommended: 100-150 for larger populations
  • specieselitefraction - Fraction of species members preserved as elite (0.0-1.0). Default: 0.2

    • Top 20% of species members are preserved during culling

Technical Details

Speciation Algorithm

  • Based on NEAT algorithm (Stanley & Miikkulainen, 2002)
  • Genetic compatibility distance calculated using excess genes, disjoint genes, and weight differences
  • Species representatives updated periodically to track evolving populations
  • Fitness sharing divides individual fitness by species size to encourage diversity (NEAT fitness sharing)

Defensive Checks

  • Added species list overflow protection (prevents crashes from excessive species creation)
  • Corrupted statistics detection with automatic fallback to default values
  • Species ID overflow protection with automatic reset
  • All defensive checks log detailed error messages for debugging

Thread Safety

  • Species list protected by Mutex for thread-safe access across simulation threads
  • Species statistics calculated safely in multi-threaded environment

Compatibility

  • Fully backward compatible
  • Existing config files work without changes (speciation disabled by default)
  • Epoch log format automatically adapts based on speciation setting
  • Visualization tools handle both old (5-column) and new (13-column) log formats
  • No breaking changes to APIs or file formats

Bug Fixes

  • Fixed potential crash from excessive species creation (now capped at 10,000 with error logging)
  • Fixed corrupted species statistics from propagating to log files
  • Improved error messages for speciation-related issues