[TGEN-3] binding *seed* does not change the basis Created: 13/Oct/12 Updated: 03/Feb/13 Resolved: 03/Feb/13 |
|
| Status: | Closed |
| Project: | test.generative |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Ben Smith-Mannschott | Assignee: | Stuart Halloway |
| Resolution: | Completed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This is what I'm observing: user=> (binding [gen/*seed* 7] (gen/uniform)) -6880819372607069048 user=> (binding [gen/*seed* 7] (gen/uniform)) 5065957067589062886 This is what I'm expecting: user=> (binding [gen/*seed* 7] (gen/uniform)) -4967725919621401576 user=> (binding [gen/*seed* 7] (gen/uniform)) -4967725919621401576 The work-around is to bind *rnd* to a new java.util.Random constructed appropriately: (binding [gen/*rnd* (java.util.Random. 7)] (gen/uniform)) I'm not sure: Is this is a bug in the doc string of *seed*? Is the bug the very existence of *seed*? (*seed* is never used.) Should the doc-string for *rnd* suggest something like the code above as a way to get a consistent basis? Should generators provide a with-seed macro to do this for us? |
| Comments |
| Comment by Stuart Halloway [ 03/Feb/13 7:13 AM ] |
|
this is fixed on master in the data.generators project |