bias

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 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 List

type List[T any] struct {
	// contains filtered or unexported fields
}

func NewList

func NewList[T any](dirtyItems []ListItem[T], config ListConfig) *List[T]

func (*List[T]) Next

func (l *List[T]) Next() T

Next returns a biased random element

type ListConfig added in v0.30.0

type ListConfig struct {
	Seed        *rand.Rand
	Temperature *float64
}

type ListItem

type ListItem[T any] struct {
	Item   T
	Weight float64
}

Jump to

Keyboard shortcuts

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