workload

package
v0.0.0-...-a595894 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: NCSA Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ValidDistributions = []string{
		"pareto",
		"zipf",
		"uniform",
		"exp", "exponential",
		"weibull",
		"poisson",
	}
	DefaultParetoParameters      = []float64{1, 1.5}
	DefaultZipfParameters        = []float64{}
	DefaultUniformParameters     = []float64{0, 1}
	DefaultExponentialParameters = []float64{0.5}
	DefaultWeibullParameters     = []float64{1.5, 1}
	DefaultPoissonParameters     = []float64{1}
)

Functions

func IsValidDistribution

func IsValidDistribution(dist string) bool

Types

type AliasTable

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

AliasTable is a discrete distribution

func NewAlias

func NewAlias(probabilities []float64, src rand.Source) AliasTable

NewAlias constructs an AliasTable that will generate the discrete distribution given in probabilities. The probabilities array should sum to 1.

func (*AliasTable) Next

func (v *AliasTable) Next() int

Next returns the next random value from the discrete distribution

type Dist

type Dist interface {
	// distuv.Quantiler
	distuv.RandLogProber
	CDF(float64) float64
	Prob(float64) float64
}

type Generator

type Generator struct {
	Dist
	// contains filtered or unexported fields
}

func New

func New(distribution string, params []float64) (*Generator, error)

func NewExponential

func NewExponential(rate float64) *Generator

func NewPareto

func NewPareto(xm float64, alpha float64) *Generator

func NewPoisson

func NewPoisson(lambda float64) *Generator

func NewUniform

func NewUniform(min float64, max float64) *Generator

func NewWeibull

func NewWeibull(k float64, lambda float64) *Generator

func NewZipf

func NewZipf(...float64) *Generator

func (*Generator) Close

func (g *Generator) Close()

func (*Generator) Generator

func (g *Generator) Generator(arry []interface{}) <-chan interface{}

func (*Generator) ModelGenerator

func (g *Generator) ModelGenerator(models assets.ModelManifests) <-chan assets.ModelManifest

func (*Generator) Next

func (g *Generator) Next(at AliasTable, arry []interface{}) interface{}

func (*Generator) Wait

func (g *Generator) Wait()

Jump to

Keyboard shortcuts

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