-
Notifications
You must be signed in to change notification settings - Fork 5
/
WorldState.py
26 lines (21 loc) · 853 Bytes
/
WorldState.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
# WorldState.py
from Tools import *
class WorldState(object):
def __init__(self):
# the environment
self.generalMovingProb = 1
print("World state has been created.")
# ",**d" in the parameter lists of the methods is a place holder
# in case we use, calling the method, a dictionary as last parameter
# set generalMovingProb
def setGeneralMovingProb(self, **d):
if "generalMovingProb" in d:
self.generalMovingProb = d["generalMovingProb"]
print("general moving probability now set to",
self.generalMovingProb, "in world state")
else:
print("*********** key 'generalMovingProb' is not defined")
self.generalMovingProb = 1
# get generalMovingProb
def getGeneralMovingProb(self):
return self.generalMovingProb