Skip to content

Commit 2abc30f

Browse files
authored
Merge pull request #492 from ocaml-multicore/use-exponential
Use exponential
2 parents 1965542 + 441cdb1 commit 2abc30f

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Next release
44

5+
- #492: Also use the new, upstreamed `Gen.exponential` combinator in STM
56
- #491: Require `qcheck.0.23`, simplify show functions by utilizing it, and update
67
expect outputs accordingly
78
- #486: Add `Util.Pp.pp_fun_` printer for generated `QCheck.fun_` functions

lib/STM.ml

+1-5
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,9 @@ struct
159159

160160
let gen_cmds_size gen s size_gen = Gen.sized_size size_gen (gen_cmds gen s)
161161

162-
let exp_dist_gen mean =
163-
let unit_gen = Gen.float_bound_inclusive 1.0 in
164-
Gen.map (fun p -> -. mean *. (log p)) unit_gen
165-
166162
let cmd_list_size_dist mean =
167163
let skew = 0.75 in (* to avoid too many empty cmd lists *)
168-
Gen.map (fun p -> int_of_float (p +. skew)) (exp_dist_gen mean)
164+
Gen.map (fun p -> int_of_float (p +. skew)) (Gen.exponential mean)
169165

170166
let arb_cmds s =
171167
let mean = 10. in (* generate on average ~10 cmds, ignoring skew *)

0 commit comments

Comments
 (0)