summaryrefslogtreecommitdiff
path: root/ricky/param/enum.py
diff options
context:
space:
mode:
Diffstat (limited to 'ricky/param/enum.py')
-rw-r--r--ricky/param/enum.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ricky/param/enum.py b/ricky/param/enum.py
index d4a839a..137c58e 100644
--- a/ricky/param/enum.py
+++ b/ricky/param/enum.py
@@ -30,8 +30,10 @@ class Enum(Param):
value = property(value_get, value_set)
- def randomize(self):
- self.value_set(random.choice(self._options))
+ def randomize(self, probabilities=None):
+ if probabilities and self._choose_from_probabilities(probabilities):
+ return
+ self.value = random.choice(self._options)
def as_dict(self):
my_dict = super(Enum, self).as_dict()