Skip to content

Commit

Permalink
Merge pull request #3 from egorse/master
Browse files Browse the repository at this point in the history
Fix #2 - merging [optimistically](http://hintjens.com/blog:106)
  • Loading branch information
lthibault authored May 20, 2019
2 parents 8d29fd5 + 1f317b5 commit a0df38e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion norm.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ func (n Norm) Jitter(d time.Duration) time.Duration {
}

samp := f()*float64(n.Stdev) + float64(n.Mean)
return d * time.Duration(samp)
return d + time.Duration(samp)
}
2 changes: 1 addition & 1 deletion univariate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ type Univariate struct {

// Jitter the duration by drawing from a univariate distribution
func (u Univariate) Jitter(d time.Duration) time.Duration {
return d * time.Duration(u.Rand())
return d + time.Duration(u.Rand())
}

0 comments on commit a0df38e

Please sign in to comment.