I'm doing a simulation program of a transport network. I want to simulate an arrival of passengers in a bus station that have a poison distribution of rate lambda.
In fact, in my conception of the program I need two lists of arrival dates: the first one is considered as the expected arrival dates for passengers and the second will be considered as the real effective arrival of passengers.
For generating time arrival I did use the following code using boost:
<blink>
double lambda(Lambda1); //mean of Poisson distr
boost::mt19937 rnd_gen; //Mersenne Twister generator
typedef boost::variate_generator<
boost::mt19937, boost::poisson_distribution<>
> rnd_poisson_t;
rnd_poisson_t rnd_poisson( rnd_gen,
boost::poisson_distribution<>( lambda ) );
rnd_poisson = rnd_poisson_t( rnd_gen,
boost::poisson_distribution<>( lambda ));
for(int i = 0; i <size;i++)
{
value=rnd_poisson();
tab[i]= rnd_poisson();
i++;
}
</blink>
The problem is if I use this code for different lists to generate the arrivals dates for the same Lambda and the same list size it will always generate the same numbers.
How do I to create a certain variation in this generation so that the two generated lists will be a little bit different?