new model system

This commit is contained in:
Barak Michener 2013-10-15 18:35:24 -04:00
parent acbf01eec0
commit 4d8d76fb42
7 changed files with 234 additions and 185 deletions

12
models/util.py Normal file
View file

@ -0,0 +1,12 @@
import random
class Bernoulli(object):
def __init__(self, percentage):
self.percentage = percentage
def rand(self):
return random.random() < self.percentage
def random(self):
return self.rand()