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

Re: [ns] Random Generator Problem



On Mon, 1 Oct 2001, Raffaele Bruno wrote:

> I have to do a lot of simulations with a not-deterministic
> behavior. I create an istance of the RNG class with
> 
> RNG *rng_ = new RNG;
> 
> but when I try to seed the RNG with:
> 
> rng_->set_seed(HEURISTIC_SEED_SOURCE,0);
> 
> I receive the following error in the compile phase:
> 
> 'HEURISTIC _SEED_SOURCE' undecleared (first use of this function)
> 
> However I included the header "rng.h". Furthermore, if I eliminate
> the set_seed function from my program it works correctly and I can
> use the other method of the class RNG (for example, I generate
> exponentially distributed random numbers) but in this way I obtain
> a deterministic behavior for all my nodes.
> 
> What I am doing wrong?

As you'll see from a grep of the code:

ranVar->set_seed(RNG::HEURISTIC_SEED_SOURCE, s);

so I'd expect

rng_->set_seed(RNG::HEURISTIC_SEED_SOURCE,0);

to work. Class hierarchies - love 'em.

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>