[GRASS-user] setting the random seed in v.perturb

Markus Neteler neteler at osgeo.org
Sat Apr 20 11:21:39 PDT 2013


On Sat, Apr 20, 2013 at 4:05 AM, Shaun Langley <shaunlangley at gmail.com> wrote:
> In v.perturb, there's an option to set the random seed.  The default value is 0.  If I want to ensure that multiple runs generate unique output, should I change the seed value?  Why is the default not tied to OS time like many other python functions?

While I have no real answer, here some related older (development related)
discussions:

On Sat, Jun 11, 2011 at 5:03 AM, Glynn Clements wrote:
> Moritz Lennert wrote:
>> So which of the two option (a seed= parameter / disabling seeding by PID
>> vs GRASS_RND_SEED) is preferrable ? I would think that we should try to
>> be consistent across modules, but r.mapcalc uses GRASS_RND_SEED and
>> v.perturb uses 'seed=' (but also doesn't use rand()). Maybe the occasion
>> to unify all this ?
>
> r.mapcalc uses an environment variable because the pre-7.0 version
> doesn't use G_parser(); all arguments are concatenated and the result
> is treated as an expression.
>
> In 7.0, adding seed= to r.mapcalc would be straightfoward; in 6.x,
> it's not really an option.

(not yet there:
 http://grass.osgeo.org/grass70/manuals/r.mapcalc.html
)

and...

On Sat, Jun 18, 2011 at 1:39 AM, Soeren Gebbert wrote:
>
> The seed option for v.random is now available in r46730 including tests.

... i.e.:
http://grass.osgeo.org/grass70/manuals/v.random.html

r.random is yet without seed option. In the long run the behaviour should
be streamlined including v.perturb.

Markus


More information about the grass-user mailing list