go-chart/sequence/random.go
Will Charczuk 814470733e snapshot.
2017-04-29 21:12:39 -07:00

22 lines
306 B
Go

package sequence
import "math/rand"
type Random struct {
rnd *rand.Rand
scale *float64
average *float64
len int
}
func (r *Random) Len() int {
return r.len
}
func (r *Random) GetValue(_ int) float64 {
if r.scale != nil {
return r.rnd.Float64() * *r.scale
}
return r.rnd.Float64()
}