Documentation ¶
Index ¶
- Variables
- func IsValidDistribution(dist string) bool
- type AliasTable
- type Dist
- type Generator
- func New(distribution string, params []float64) (*Generator, error)
- func NewExponential(rate float64) *Generator
- func NewPareto(xm float64, alpha float64) *Generator
- func NewPoisson(lambda float64) *Generator
- func NewUniform(min float64, max float64) *Generator
- func NewWeibull(k float64, lambda float64) *Generator
- func NewZipf(...float64) *Generator
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 ¶
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 Generator ¶
type Generator struct { Dist // contains filtered or unexported fields }
func NewExponential ¶
func NewPoisson ¶
func NewUniform ¶
func NewWeibull ¶
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{}
Click to show internal directories.
Click to hide internal directories.