Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: Same seed but different results !

New Message Reply Date view Thread view Subject view Author view

Subject: Re: Same seed but different results !
From: Pierre (bommel@cirad.fr)
Date: Sat May 01 2010 - 16:42:05 CEST

Olá Geraldine,
There are hidden routines in Smalltalk that use the randomness. This is
the case for example to transform a Set into OrderedCollection: since
the elements included in the Set are mixed up, the call of method
asOrderedCollection requires a random trial. This one is independent of
"Cormas random" that you use in your model. Therefore, if you use such
routines, you may obtain different results for each simulation.
Thus for this example, it is better to use IndexedSet rather than Set.
Because Dictionary is a subclass of Set, you may have the same type of
hidden routines by transforming a Dictionary in OrderedCollection as
Nico explained.
Boa sorte,
    Pierre

Nicolas Becu a écrit :
> Geraldine, If you come up with a solution for a Dictionary that
> wouldn't cause unwanted randomness (perhaps a new Dictionary class as
> it has been done for the IndexedSet class) it would be great to send
> the code. I've been looking for that for a model of mine some time ago
> and i'm sure other users would be interested as well.
>
> cheers and have nice coding week end ;)
>
> Nicolas
>
> 2010/5/1 Serge Stinckwich <serge.stinckwich@gmail.com
> <mailto:serge.stinckwich@gmail.com>>
>
> Do you have code example ?
>
> 2010/4/30 Abrami Géraldine <geraldine.abrami@cemagref.fr
> <mailto:geraldine.abrami@cemagref.fr>>:
> > Hi everybody
> > Of course i am talking about random generator seeds :)
> > I am very worried about the stability of my model as it looks
> that i obtain
> > very different results with the same seed...
> > I guess it must be a matter of numbers format and rounding...
> > Has anybody ever come to this issue? Some clues on how to
> resolve it ?
> > Thanks
> > geraldine
> >
> >
> >
> > Géraldine Abrami
> >
> > UMR G-eau
> >
> > Gestion de l'Eau, Acteurs, Usages
> >
> > Cemagref Montpellier
> >
> > 361 rue JF Breton
> >
> > BP 5095 34196 Montpellier Cedex 05
> >
> > +33 4 67 04 63 69
> >
> >
> >
> >
>
>
>
> --
> Serge Stinckwich
> UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
> Every DSL ends up being Smalltalk
> http://doesnotunderstand.org/
>
>

-- 
--------------------------------
Pierre Bommel - CIRAD - UR Green
UnB - Faculdade de tecnologia.
Departamento de engenharia mecânica
Campus universitário Darcy Ribeiro
Asa norte   	Brasília - DF
tel : (00 55 61) 3208 3405
cel : (00 55 61) 8122 2878
http://www.cirad.fr/ur/green
-------------------------------- 

New Message Reply Date view Thread view Subject view Author view
 

Back to home