swarm-support
[Top][All Lists]
Advanced

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

[Swarm-Support] Random Number Generator and Distributions(continuing)


From: Emerson Aguiar Noronha
Subject: [Swarm-Support] Random Number Generator and Distributions(continuing)
Date: Thu, 29 Jan 2009 11:21:22 -0200 (BRST)
User-agent: SquirrelMail/1.4.6 [CVS]-0.cvs20050812.1.fc3

Hello all,

Continuing with that email about RNG and distributions in swarm.

Ive made a change in the code and now its seems to be working according
with the distributions. But i´d like informations of why that behavior
could happen.

Now i creating setting a new instance of the rng s object instead of using
the swarm´s standard global rng object. Id like to know:

a. in code line(3..4): is that the better way of obtaing and setting a seed?

b. according wich ive read, its not necessary to create and set
programaticaly(line 2 .. 4) the rng object and is seed for the
distribution.

c. the same occurs using the uniform unsigned
implementation(UniformUnsignedDistImpl)

Follow the CODE:


 //Bernoulli
(1)MT19937genImpl    rng  = new MT19937genImpl(Globals.env.globalZone);

(2)BernoulliDistImpl dist = new BernoulliDistImpl(Globals.env.globalZone,
rng);

(3)int seed = Globals.env.randomGenerator.getUnsignedSample();

(4)rng.setStateFromSeed(seed);

(5)dist.setProbability(0.5);
//V.A
this.myinitialstate = dist.getIntegerSample();


thanks all of you,

-- 
Emerson A. Noronha
Master Degree - Information Engineering
Federal University of ABC(UFABC) - Brazil
Center of Mathematics, Computing and Cognition(CMCC)


------------------------------------------------------------------
Serviço de Webmail da UFABC.
Apoio: Núcleo de Tecnologia da Informação UFABC 
http://www.ufabc.edu.br/



reply via email to

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