class DiscreteUniform(StochasticParameter):
def __init__(self, a, b=None):
if isinstance(a, DiscreteUniform):
self.a = a.a
self.b = a.b
elif isinstance(a, int):
assert b is not None and isinstance(b, int)
assert a <= b
self.a = a
self.b = b
else:
raise Exception("Expected two int values or DiscreteUniform object, got %s, %s." % (type(a), type(b)))
def _draw_samples(self, size, random_state):
return random_state.randint(self.a, self.b, size)