if(self.distType=="Fixed"):#if the distribution is Fixed
number=self.avg
elif(self.distType=="Exp"):#if the distribution is Exponential
number=G.Rnd.expovariate(1.0/(self.avg))
elif(self.distType=="Normal"):#if the distribution is Normal
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))
elif(self.distributionType=="Normal"):#if the distribution is Normal
while1:
number=G.Rnd.normalvariate(self.avg,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
break
elifself.distType=="Erlang":#if the distribution is erlang
number=G.Rnd.gammavariate(self.alpha,self.beta)
returnnumber
elifself.distributionType=="Erlang":#if the distribution is erlang
returnG.Rnd.gammavariate(self.alpha,self.beta)
else:
raiseValueError("Unknown distribution %r used in %s %s"%