swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Swarm tutorial, random number generator


From: Sven N. Thommesen
Subject: Re: [Q] Swarm tutorial, random number generator
Date: Mon, 06 Apr 1998 14:30:26 -0500

At 03:10 PM 4/6/1998 +0900, Norberto Eiji Nawa wrote:
>Hello everybody,
>
>I am now following the tutorial written by Chris Langton and available
>in Benedikt Stefansson's home page in order to get used to the spirit
>of the Swarm package.
>
>One thing that caught my attention is that when running the example
>simpleObjCBug2, the bug always finds food in the same places and
>following the same path. The distribution of food in the 2D grid
>should be random and the bug should perform random walks, so I guess
>there is something weird happening in the interaction of the random
>number generator libraries and the machine I am using.


Eiji,

that's by design. The default random generator is started with the same
seed on every run, to allow you to replicate your experiment.

If you want the runs to be different, you need to start you application
this way:
        % ./appname -varySeed

This will ensure that different runs will have different starting seeds for
the generator. (But in this case, if you want to replicate a specific run
later, you need to query the generator to find out which seed was used to
start it. See the random library documentation for details.)

Good luck,
Sven


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]