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
|
|
0
|
|
|
|
Reply
|
use.address (75)
|
9/10/2011 2:26:19 PM |
|
"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 ---
|
|
0
|
|
|
|
Reply
|
pchristor (950)
|
9/10/2011 4:04:40 PM
|
|
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 .
|
|
0
|
|
|
|
Reply
|
nntp24 (1559)
|
9/11/2011 8:41:31 PM
|
|
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.'
|
|
0
|
|
|
|
Reply
|
miles7 (230)
|
9/12/2011 1:02:53 AM
|
|