score

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interval

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

func NewInterval

func NewInterval(start, end int64) *Interval

func (Interval) IsContain

func (i Interval) IsContain(val int64) bool

type Intervals

type Intervals struct {
	MinInterval  *Interval
	ZeroInterval *Interval
	MidInterval  *Interval
	MaxInterval  *Interval
}

func NewIntervals

func NewIntervals(min, zero, mid int64) Intervals

func (Intervals) ToScore

func (is Intervals) ToScore(val int64) TScore

type SScore

type SScore struct {
	Score TScore
	Name  string
}

func NewMaxScore

func NewMaxScore(name string) SScore

func NewMidScore

func NewMidScore(name string) SScore

func NewMinScore

func NewMinScore(name string) SScore

func NewScore

func NewScore(score TScore, name string) SScore

func NewZeroScore

func NewZeroScore() SScore

func (SScore) GetScore

func (v SScore) GetScore() TScore

func (SScore) String

func (v SScore) String() string

type ScoreBucket

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

func NewScoreBuckets

func NewScoreBuckets() *ScoreBucket

func (*ScoreBucket) AvoidScore

func (b *ScoreBucket) AvoidScore() int

func (*ScoreBucket) NormalScore

func (b *ScoreBucket) NormalScore() int

func (*ScoreBucket) PreferScore

func (b *ScoreBucket) PreferScore() int

func (*ScoreBucket) SetScore

func (b *ScoreBucket) SetScore(score SScore, prefer tristate.TriState) *ScoreBucket

func (*ScoreBucket) String

func (b *ScoreBucket) String() string

type TScore

type TScore int
const (
	MinScore  TScore = -1
	ZeroScore TScore = 0
	MidScore  TScore = 1
	MaxScore  TScore = 2

	ZeroScoreName = "zero"
)

Jump to

Keyboard shortcuts

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