Module: Musa::Darwin
- Included in:
- All
- Defined in:
- lib/musa-dsl/generative/darwin.rb
Overview
Evolutionary selection algorithm based on fitness evaluation.
Darwin implements a selection algorithm inspired by natural selection, evaluating and ranking a population of objects based on defined measures (features and dimensions) and weights. Objects are measured, scored, and sorted by fitness for evolutionary algorithms or optimization.
Core Concepts
- Population: Collection of objects to evaluate
- Measures: Evaluation criteria for each object
- Features: Boolean flags (present/absent)
- Dimensions: Numeric values (continuous)
- Die: Mark object as non-viable (eliminated)
- Weights: Importance multipliers for features/dimensions
- Fitness: Calculated score from normalized dimensions and features
- Selection: Population sorted by fitness (highest first)
Evaluation Process
- Measure: Evaluate each object with measures block
- Normalize: Scale dimension values to 0-1 range
- Weight: Apply weights to dimensions and features
- Score: Calculate total fitness for each object
- Sort: Order population by fitness (descending)
Musical Applications
- Select best harmonic progressions from generated candidates
- Rank melodic variations by aesthetic criteria
- Optimize rhythmic patterns for complexity/simplicity
- Evolve musical structures through iterative selection
Defined Under Namespace
Classes: Darwin