ExponentialDistribution exp = new ExponentialDistribution(4.0);
for(int i = 1; i < 20; i++){
timestamp[i] = (int)exp.sample() + 1+timestamp[i-1];
Here timestamp is an array of integers and a random value is assigned to it with above condition. What does (int)exp.sample() does and how it assigns a random value to i?
Aucun commentaire:
Enregistrer un commentaire