Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #10028 > unrolled thread
| Started by | Chris Gordon-Smith <use.address@my.homepage> |
|---|---|
| First post | 2011-09-10 14:26 +0000 |
| Last post | 2011-09-12 10:02 +0900 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.lang.c++
Factors Inhibiting Reproducability Of Simulation Results Chris Gordon-Smith <use.address@my.homepage> - 2011-09-10 14:26 +0000
Re: Factors Inhibiting Reproducability Of Simulation Results "Paul" <pchristor@yahoo.co.uk> - 2011-09-10 17:04 +0100
Re: Factors Inhibiting Reproducability Of Simulation Results Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-11 20:41 +0000
Re: Factors Inhibiting Reproducability Of Simulation Results Miles Bader <miles@gnu.org> - 2011-09-12 10:02 +0900
| From | Chris Gordon-Smith <use.address@my.homepage> |
|---|---|
| Date | 2011-09-10 14:26 +0000 |
| Subject | Factors Inhibiting Reproducability Of Simulation Results |
| Message-ID | <9d1acbF38fU2@mid.individual.net> |
I just managed to get my artificial chemistry simulation producing the same results when I run it twice with the same parameters. Perhaps some members of the group will be interested in the two factors that led to differing results: 1) My graphics library (GTKMM2) calling rand() at random times between the calls made by my code 2) My code storing pointers in an std::set, and then iterating over the set. The ordering is dependent on the memory locations of the dynamically allocated objects to which the pointers point. Chris Gordon-Smith www.simsoup.info
[toc] | [next] | [standalone]
| From | "Paul" <pchristor@yahoo.co.uk> |
|---|---|
| Date | 2011-09-10 17:04 +0100 |
| Message-ID | <j4g1ri$2tfc$1@adenine.netfront.net> |
| In reply to | #10028 |
"Chris Gordon-Smith" <use.address@my.homepage> wrote in message news:9d1acbF38fU2@mid.individual.net... >I just managed to get my artificial chemistry simulation producing the > same results when I run it twice with the same parameters. Perhaps some > members of the group will be interested in the two factors that led to > differing results: > > 1) My graphics library (GTKMM2) calling rand() at random times between > the calls made by my code > 2) My code storing pointers in an std::set, and then iterating over the > set. The ordering is dependent on the memory locations of the dynamically > allocated objects to which the pointers point. > Congrats on reaching that milestone in your project, it looks like an interesting one. Thanks for the info. :) --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---
[toc] | [prev] | [next] | [standalone]
| From | Jorgen Grahn <grahn+nntp@snipabacken.se> |
|---|---|
| Date | 2011-09-11 20:41 +0000 |
| Message-ID | <slrnj6q77p.gtj.grahn+nntp@frailea.sa.invalid> |
| In reply to | #10028 |
On Sat, 2011-09-10, Chris Gordon-Smith wrote: > I just managed to get my artificial chemistry simulation producing the > same results when I run it twice with the same parameters. Perhaps some > members of the group will be interested in the two factors that led to > differing results: > > 1) My graphics library (GTKMM2) calling rand() at random times between > the calls made by my code Aargh! But in a sense that's just another example of the brokenness of rand(). You usually want a PRNG where you keep the state manually. I assume the TR1 random number stuff can do that. /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o .
[toc] | [prev] | [next] | [standalone]
| From | Miles Bader <miles@gnu.org> |
|---|---|
| Date | 2011-09-12 10:02 +0900 |
| Message-ID | <87sjo2incy.fsf@catnip.gol.com> |
| In reply to | #10050 |
Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >> 1) My graphics library (GTKMM2) calling rand() at random times between >> the calls made by my code > > Aargh! But in a sense that's just another example of the brokenness > of rand(). You usually want a PRNG where you keep the state manually. > I assume the TR1 random number stuff can do that. The random state in both TR1 and C++11 is a part of the generator object, so ... yeah. [Of course it would be super duper surprising if this wasn't true!] -Miles -- `There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.'
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c++
csiph-web