predictor

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PredictionMode

type PredictionMode int

PredictionMode defines the mode used for the predictors simulation

const (
	// PredictionModeRootTx defines the mode "RootTx", which uses the TSProfile's root transition matrix
	PredictionModeRootTx PredictionMode = 0

	// PredictionModePhases defines the mode "Phases", which uses the TSProfile's phases
	PredictionModePhases PredictionMode = 1

	// PredictionModePeriods defines the mode "Periods", which uses the TSProfile's periods
	PredictionModePeriods PredictionMode = 2
)

type Predictor

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

Predictor offers prediction of the TSProfile the predictor is bound to

func NewPredictor

func NewPredictor(profile models.TSProfile) *Predictor

NewPredictor returns a new predictor for the given TSProfile

func (*Predictor) Likeliness

func (predictor *Predictor) Likeliness(currentState map[string]string, steps int) (map[string][]int, error)

Likeliness ...

func (*Predictor) SetMode

func (predictor *Predictor) SetMode(mode PredictionMode)

SetMode defines the given PredictionMode for the next simulation

func (*Predictor) SetPeriodPath

func (predictor *Predictor) SetPeriodPath(periodPath []int, periodPathDepth int)

SetPeriodPath defines the current path in the period tree

func (*Predictor) SetPhase

func (predictor *Predictor) SetPhase(currentPhase int)

SetPhase defines the given phase for the next simulation

func (*Predictor) SetState

func (predictor *Predictor) SetState(currentState map[string]string)

SetState defines the given currentState for the next simulation

func (*Predictor) Simulate

func (predictor *Predictor) Simulate(steps int) ([][]models.TSState, error)

Simulate computes `steps` states using randomness and TSProfile's probabilities

Jump to

Keyboard shortcuts

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