Commit e5ddce48 authored by Georgios Dagkakis's avatar Georgios Dagkakis

new attributes set for RandomNumberGenerator

parent aea2932a
...@@ -26,7 +26,8 @@ Created on 14 Feb 2013 ...@@ -26,7 +26,8 @@ Created on 14 Feb 2013
holds methods for generations of numbers from different distributions holds methods for generations of numbers from different distributions
''' '''
class RandomNumberGenerator(object): class RandomNumberGenerator(object):
def __init__(self, obj, distributionType, mean=0, stdev=0, min=0, max=0, alpha=0, beta=0): def __init__(self, obj, distributionType, mean=0, stdev=0, min=0, max=0, alpha=0, beta=0,
logmean=0,logsd=0, probability=0, shape=0, scale=0, location=0):
self.distributionType = distributionType self.distributionType = distributionType
self.mean = float(mean or 0) self.mean = float(mean or 0)
self.stdev = float(stdev or 0) self.stdev = float(stdev or 0)
...@@ -34,8 +35,16 @@ class RandomNumberGenerator(object): ...@@ -34,8 +35,16 @@ class RandomNumberGenerator(object):
self.max = float(max or 0) self.max = float(max or 0)
self.alpha = float(alpha or 0) self.alpha = float(alpha or 0)
self.beta = float(beta or 0) self.beta = float(beta or 0)
self.logmean=float(logmean or 0)
self.logsd=float(logsd or 0)
self.probability=float(probability or 0)
self.shape=float(shape or 0)
self.scale=float(scale or 0)
self.location=float(location or 0)
self.obj = obj self.obj = obj
def generateNumber(self): def generateNumber(self):
from Globals import G from Globals import G
if(self.distributionType=="Fixed"): #if the distribution is Fixed if(self.distributionType=="Fixed"): #if the distribution is Fixed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment