class Crowbar::Evolution::Corpus

Overview

Population pool managing candidate test inputs scored by fitness, augmented with multi-feature coverage bucketing for novelty preservation.

Defined in:

crowbar/evolution/corpus.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(max_size : Int32 = 64) #

Instance Method Detail

def add(candidate : Candidate) : Bool #

Adds a candidate to the population pool. If the candidate discovers an unseen feature or coverage hash, it is permanently bucketed.


def all_unique_candidates : Array(Candidate) #

Returns the combined set of general population and novelty feature representatives


def best : Candidate | Nil #

def candidates : Array(Candidate) #

def clear #

def coverage_buckets : Hash(UInt64, Candidate) #

def cull_stagnant(keep_ratio : Float64 = 0.5) #

Purges bottom half of population during stagnation to clear local minima Note: Novelty feature buckets are strictly preserved


def empty? : Bool #

def feature_buckets : Hash(String, Candidate) #

def has_coverage_hash?(cov : UInt64) : Bool #

Checks if a coverage hash has already been discovered


def has_feature?(feature : String) : Bool #

Checks if a feature tag has already been discovered


def max_size : Int32 #

def max_size=(max_size : Int32) #

def roulette_select(prng : PRNG) : Candidate | Nil #

Fitness-proportional (Roulette Wheel) Selection


def size : Int32 #

def tournament_select(prng : PRNG, k : Int32 = 4) : Candidate | Nil #

K-way Tournament Selection across general and novelty candidates