predictor

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackoffPredictor

type BackoffPredictor struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *BackoffPredictor

func (*BackoffPredictor) ContextsObserved

func (p *BackoffPredictor) ContextsObserved() int

func (*BackoffPredictor) HasObservedContext

func (p *BackoffPredictor) HasObservedContext(history []core.TemplateID, route string) bool

func (*BackoffPredictor) Observe

func (p *BackoffPredictor) Observe(history []core.TemplateID, route string, next core.TemplateID)

func (*BackoffPredictor) Predict

func (p *BackoffPredictor) Predict(history []core.TemplateID, route string, limit int) []core.Prediction

func (*BackoffPredictor) PredictFromTemplate

func (p *BackoffPredictor) PredictFromTemplate(templateID core.TemplateID, route string, limit int) []core.Prediction

func (*BackoffPredictor) Restore

func (p *BackoffPredictor) Restore(snapshot Snapshot) error

func (*BackoffPredictor) Snapshot

func (p *BackoffPredictor) Snapshot() Snapshot

type Config

type Config struct {
	MaxOrder int
	Alpha    float64
}

type ContextSnapshot

type ContextSnapshot struct {
	Route string
	Order int
	IDs   [3]core.TemplateID
	Total int
	Next  map[core.TemplateID]int
}

type Snapshot

type Snapshot struct {
	Contexts []ContextSnapshot
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL