Documentation
¶
Overview ¶
Package focus accumulates confidence by counting β consecutive successes.
If wave reports success (both thresholds cleared), Focus advances a counter. Reaching β signals local finality for the choice under consideration. This is the constructive-interference analogue in the metaphor: persistence, not amplitude, creates a stable signal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Confidence ¶
type Confidence[ID comparable] struct { // contains filtered or unexported fields }
Confidence tracks confidence building for consensus
func NewConfidence ¶
func NewConfidence[ID comparable](threshold int, alpha float64) *Confidence[ID]
func (*Confidence[ID]) State ¶
func (c *Confidence[ID]) State(id ID) (int, bool)
func (*Confidence[ID]) Update ¶
func (c *Confidence[ID]) Update(id ID, ratio float64)
type Tracker ¶
type Tracker[ID comparable] struct { // contains filtered or unexported fields }
Tracker tracks confidence counters for items
func NewTracker ¶
func NewTracker[ID comparable]() *Tracker[ID]
type WindowedConfidence ¶
type WindowedConfidence[ID comparable] struct { // contains filtered or unexported fields }
WindowedConfidence tracks confidence with time windows
func NewWindowed ¶
func NewWindowed[ID comparable](threshold int, alpha float64, window time.Duration) *WindowedConfidence[ID]
func (*WindowedConfidence[ID]) State ¶
func (w *WindowedConfidence[ID]) State(id ID) (int, bool)
func (*WindowedConfidence[ID]) Update ¶
func (w *WindowedConfidence[ID]) Update(id ID, ratio float64)
Click to show internal directories.
Click to hide internal directories.