コード例 #1
0
 def calculate_T(self, state, action):
     if action:
         return [(0.8, self.go(state, action)),
                 (0.1, self.go(state, turn_right(action))),
                 (0.1, self.go(state, turn_left(action)))]
     else:
         return [(0.0, state)]
コード例 #2
0
 def T(self, state, action):
     if action is None:
         return [(0.0, state)]
     else:
         return [(0.8, self.go(state, action)),
                 (0.1, self.go(state, turn_right(action))),
                 (0.1, self.go(state, turn_left(action)))]
コード例 #3
0
 def interpret(self, action):
     #Direction: 0 = straight, 1 = left, 2 = right
     if action == 1:
         return turn_left(self.direction)
     elif action == 2:
         return turn_right(self.direction)
     return self.direction
コード例 #4
0
ファイル: mdp.py プロジェクト: cbasich1/Incomplete-MDPs
	def calculate_T(self,s,a):
		if a:
			return [(0.8, self.go(s, a)),
					(0.1, self.go(s, turn_right(a))),
					(0.1, self.go(s, turn_left(a)))]
		else:
			return [(0.0, s)]
コード例 #5
0
ファイル: mdp.py プロジェクト: NeelShah18/aima-python
 def calculate_T(self, state, action):
     if action:
         return [(0.8, self.go(state, action)),
                 (0.1, self.go(state, turn_right(action))),
                 (0.1, self.go(state, turn_left(action)))]
     else:
         return [(0.0, state)]
コード例 #6
0
 def calculate_T(self, state, action, d_rand):
     if action:
         stoch = (1 - d_rand) / 2
         return [(d_rand, self.go(state, action)),
                 (stoch, self.go(state, turn_right(action))),
                 (stoch, self.go(state, turn_left(action)))]
     else:
         return [(0.0, state)]