def __init__(self, alpha = 0.1, beta = 0.1): Function.__init__(self) self.uniformRNG = UniformRNG() self.betavariateRNG = _BetavariateRNG() self.alpha = make_function(alpha) self.beta = make_function(beta)
def __init__(self, alpha=0.1, beta=0.1): Function.__init__(self) self.uniformRNG = UniformRNG() self.betavariateRNG = _BetavariateRNG() self.alpha = make_function(alpha) self.beta = make_function(beta)
def __init__(self, value_generator, mode='unbound', lower=None, upper=None, sum0=0): """ Return an Accumulator instance. If mode is 'unbound' (default value) the accumulation is not limited. If mode is 'reflect' or 'r' or 'mirror' or 'm', the Accumulator folds values inside the [lower, upper] range. lower and upper must be specified and may be functions. If mode 'wrap' or 'w', the Accumulator performs a wrap around at the lower and upper limits. lower and upper must be specified and may be functions. An Accumulator can be initialized by passing the sum0 argument. """ Function.__init__(self) self.generator = make_function(value_generator) self.sum = sum0 if mode in ['unbound', 'u']: self.add = self.noBounds else: if upper is None or lower is None: raise ValueError( 'cannot create a bound accumulator with undefined bounds') self.upper = make_function(upper) self.lower = make_function(lower) if mode in ['limit', 'l']: self.add = self.limitAtBounds elif mode in ['reflect', 'r', 'mirror', 'm']: self.add = self.reflectAtBounds elif mode in ['wrap', 'w']: self.add = self.wrapAtBounds else: raise ValueError( "mode can only be 'unbound', 'limit', 'reflect', 'mirror' or 'wrap' (got %s)" % mode)
def __init__(self, pair0, *pairs): Function.__init__(self) for pair in pairs: if type(pair) is not types.TupleType: raise ValueError, "pair (object, probability) expected. got %s", repr(pair) self.set = [] for o, p in [pair0] + list(pairs): self.set.append(_PossibleChoice(o, make_function(p)))
def __init__(self, pair0, *pairs): Function.__init__(self) for pair in pairs: if type(pair) is not types.TupleType: raise ValueError, 'pair (object, probability) expected. got %s', repr(pair) self.set = [] for o, p in [pair0] + list(pairs): self.set.append(_PossibleChoice(o, make_function(p)))
def __init__(self, value_generator, mode="unbound", lower=None, upper=None, sum0=0): """ Return an Accumulator instance. If mode is 'unbound' (default value) the accumulation is not limited. If mode is 'reflect' or 'r' or 'mirror' or 'm', the Accumulator folds values inside the [lower, upper] range. lower and upper must be specified and may be functions. If mode 'wrap' or 'w', the Accumulator performs a wrap around at the lower and upper limits. lower and upper must be specified and may be functions. An Accumulator can be initialized by passing the sum0 argument. """ Function.__init__(self) self.generator = make_function(value_generator) self.sum = sum0 if mode in ["unbound", "u"]: self.add = self.noBounds else: if upper is None or lower is None: raise ValueError, "cannot create a bound accumulator with undefined bounds" self.upper = make_function(upper) self.lower = make_function(lower) if mode in ["limit", "l"]: self.add = self.limitAtBounds elif mode in ["reflect", "r", "mirror", "m"]: self.add = self.reflectAtBounds elif mode in ["wrap", "w"]: self.add = self.wrapAtBounds else: raise ValueError, "mode can only be 'unbound', 'limit', 'reflect', 'mirror' or 'wrap' (got %s)" % mode
def __init__(self, alpha=0.5, beta=2.0): Generator.__init__(self) self.alpha = make_function(alpha) self.beta = make_function(beta) self.weibullvariateRNG = _WeibullvariateRNG()
def __init__(self, mainFunction, lowerLimit, upperLimit, exp=0.0): Function.__init__(self) self.upperLimit = make_function(upperLimit) self.lowerLimit = make_function(lowerLimit) self.mainFunction = make_function(mainFunction) self.exponent = math.pow(2.0, exp)
def __init__(self, generator, points, strength=1.0, exponent=0.0): Function.__init__(self) self.generator = make_function(generator) self.points = make_function(points) self.strength = make_function(strength) self.exponent = make_function(exponent)
def __init__(self, generator, delta, strength=1.0, offset=0.0): Function.__init__(self) self.generator = make_function(generator) self.delta = make_function(delta) self.strength = make_function(strength) self.offset = make_function(offset)
def __init__(self, mainFunction, lowerLimit, upperLimit, exp = 0.0): Function.__init__(self) self.upperLimit = make_function(upperLimit) self.lowerLimit = make_function(lowerLimit) self.mainFunction = make_function(mainFunction) self.exponent = math.pow(2.0, exp)
def __init__(self, generator, delta, strength = 1.0, offset = 0.0): Function.__init__(self) self.generator = make_function(generator) self.delta = make_function(delta) self.strength = make_function(strength) self.offset = make_function(offset)
def __init__(self, generator, points, strength = 1.0, exponent = 0.0): Function.__init__(self) self.generator = make_function(generator) self.points = make_function(points) self.strength = make_function(strength) self.exponent = make_function(exponent)
def __init__(self, mu = 0.5, sigma = 0.1): Function.__init__(self) self.mu = make_function(mu) self.sigma = make_function(sigma) self.gaussRNG = _GaussRNG()
def __init__(self, lambd = 1.0): Function.__init__(self) self.lambd = make_function(lambd) self.expovariateRNG = _ExpovariateRNG() self.uniformRNG = UniformRNG()
def __init__(self, alpha=0.1, mu=0.5): Function.__init__(self) self.alpha = make_function(alpha) self.mu = make_function(mu) self.uniformRNG = UniformRNG()
def __init__(self, mu=0.5, sigma=0.1): Function.__init__(self) self.mu = make_function(mu) self.sigma = make_function(sigma) self.gaussRNG = _GaussRNG()
def __init__(self, lambd=1.0): Function.__init__(self) self.lambd = make_function(lambd) self.expovariateRNG = _ExpovariateRNG() self.uniformRNG = UniformRNG()
def __init__(self, alpha = 0.5, beta = 2.0): Generator.__init__(self) self.alpha = make_function(alpha) self.beta = make_function(beta) self.weibullvariateRNG = _WeibullvariateRNG()
def __init__(self, alpha = 0.1, mu = 0.5): Function.__init__(self) self.alpha = make_function(alpha) self.mu = make_function(mu) self.uniformRNG = UniformRNG()