Commit 165a59fc authored by Jérome Perrin's avatar Jérome Perrin

RNG: support the fact that GUI will save values as empty string

parent 6981dad9
...@@ -28,12 +28,12 @@ holds methods for generations of numbers from different distributions ...@@ -28,12 +28,12 @@ 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):
self.distributionType = distributionType self.distributionType = distributionType
self.mean = float(mean) self.mean = float(mean or 0)
self.stdev = float(stdev) self.stdev = float(stdev or 0)
self.min = float(min) self.min = float(min or 0)
self.max = float(max) self.max = float(max or 0)
self.alpha = float(alpha) self.alpha = float(alpha or 0)
self.beta = float(beta) self.beta = float(beta or 0)
self.obj = obj self.obj = obj
def generateNumber(self): def generateNumber(self):
......
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