new model system
This commit is contained in:
parent
acbf01eec0
commit
4d8d76fb42
7 changed files with 234 additions and 185 deletions
12
models/util.py
Normal file
12
models/util.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue