class Crowbar::Evolution::Bandit

Overview

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.

Defined in:

crowbar/evolution/bandit.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(exploration_coeff : Float64 = 1.41421356) #

Instance Method Detail

def arms : Hash(String, Arm) #

def ensure_arm(name : String) : Arm #

Ensure an arm is registered


def exploration_coeff : Float64 #

def exploration_coeff=(exploration_coeff : Float64) #

def pulls_for(name : String) : Int64 #

def record_pull(name : String) #

Record that an arm was executed


def reward(name : String, value : Float64) #

Credit an arm with a reward


def rewards_for(name : String) : Float64 #

def score_for(name : String) : Float64 #

Retrieve score for inspection/telemetry


def select(available_arms : Array(String), prng : PRNG) : String #

Select the best arm among available names based on UCB1 score


def total_pulls : Int64 #

def total_pulls=(total_pulls : Int64) #