Ejemplo n.º 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)]
Ejemplo n.º 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)))]
Ejemplo n.º 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
Ejemplo n.º 4
0
	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)]
Ejemplo n.º 5
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)]
Ejemplo n.º 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)]