forked from ANRGUSC/TCRsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.py
35 lines (24 loc) · 743 Bytes
/
Item.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import random
class Item():
PERCENT_CHANCE = 0.5
def __init__(self):
self.__mValid = None
self.__mAccepted = None
self.__mObjection = False
def set_validity(self, valid=None):
if (valid == None):
self.__mValid = random.random() < Item.PERCENT_CHANCE
else:
self.__mValid = valid
def is_valid(self):
return self.__mValid
def set_acceptance(self, accepted):
self.__mAccepted = accepted
def is_accepted(self):
return self.__mAccepted
def is_objection(self):
return self.__mObjection
def set_objection(self):
self.__mObjection = True
def remove_objection(self):
self.__mObjection = False