class

Crowbar::Evolution::Bandit

Inherits Reference < Object

Multi-Armed Bandit credit assignment using the Upper Confidence Bound (UCB1) algorithm. Dynamically balances exploitation of high-yield mutators/scopes with exploration of less-tested ones.

Constructors

new(exploration_coeff : Float64 = 1.41421356)
Source

Instance methods

arms
Source
ensure_arm(name : String) : Arm

Ensure an arm is registered

Source
exploration_coeff
Source
exploration_coeff=(exploration_coeff : Float64)
Source
pulls_for(name : String) : Int64
Source
record_pull(name : String)

Record that an arm was executed

Source
reward(name : String, value : Float64)

Credit an arm with a reward

Source
rewards_for(name : String) : Float64
Source
score_for(name : String) : Float64

Retrieve score for inspection/telemetry

Source
select(available_arms : Array(String), prng : PRNG) : String

Select the best arm among available names based on UCB1 score

Source
total_pulls
Source
total_pulls=(total_pulls : Int64)
Source

Nested types