Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- class Probability(object):
- """docstring for Probability"""
- def __init__(self, n, p, nh, nd):
- super(Probability, self).__init__()
- self.n = n
- self.p = p
- self.nh = nh
- self.nd = nd
- self.peopleInHotel = [[[] for x in range(nd)] for y in range(nh)]
- # n = 10000 p = 0.1 nh = 100 nd = 100
- def generateData(self):
- for x in range(0,self.n):
- for y in range(0,self.nd):
- if random.random() < self.p:
- self.peopleInHotel[y,random.randrange(self.nh)].a x;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement