@@ -42,14 +41,14 @@ class RandomNumberGenerator(object):
if(self.distributionType=="Fixed"):#if the distribution is Fixed
returnself.mean
elif(self.distributionType=="Exp"):#if the distribution is Exponential
returnG.Rnd.expovariate(1.0/(self.avg))
returnG.Rnd.expovariate(1.0/(self.mean))
elif(self.distributionType=="Normal"):#if the distribution is Normal
ifself.max<self.min:
raiseValueError("Normal distribution for %s uses wrong "
"parameters. max (%s) > min (%s)"%(
self.obj.id,self.max,self.min))
while1:
number=G.Rnd.normalvariate(self.avg,self.stdev)
number=G.Rnd.normalvariate(self.mean,self.stdev)
ifnumber>self.maxornumber<self.minandmax!=0:#if the number is out of bounds repeat the process #if max=0 this means that we did not have time "time" bounds
continue
else:#if the number is in the limits stop the process