Toggeable confidence-ellipse (key_c)
This commit is contained in:
parent
a0953116f1
commit
54adebfe9b
@ -43,6 +43,7 @@ class ColumbusEnv(gym.Env):
|
|||||||
self.draw_observable = True
|
self.draw_observable = True
|
||||||
self.draw_joystick = True
|
self.draw_joystick = True
|
||||||
self.draw_entities = True
|
self.draw_entities = True
|
||||||
|
self.draw_confidence_ellipse = True
|
||||||
self.void_barrier = True
|
self.void_barrier = True
|
||||||
self.void_damage = 100
|
self.void_damage = 100
|
||||||
|
|
||||||
@ -223,7 +224,8 @@ class ColumbusEnv(gym.Env):
|
|||||||
pygame.draw.circle(self.screen, smolcol, (20+int(60*x) +
|
pygame.draw.circle(self.screen, smolcol, (20+int(60*x) +
|
||||||
self.joystick_offset[0], 20+int(60*y)+self.joystick_offset[1]), 20, width=0)
|
self.joystick_offset[0], 20+int(60*y)+self.joystick_offset[1]), 20, width=0)
|
||||||
|
|
||||||
def _draw_confidence_ellipse(self, chol, seconds=1):
|
def _draw_confidence_ellipse(self, chol, forceDraw=False, seconds=1):
|
||||||
|
if (self.draw_confidence_ellipse or forceDraw) and self.visible:
|
||||||
col = (255, 255, 255)
|
col = (255, 255, 255)
|
||||||
f = seconds/self.speed_fac
|
f = seconds/self.speed_fac
|
||||||
|
|
||||||
@ -267,6 +269,8 @@ class ColumbusEnv(gym.Env):
|
|||||||
self.keypress_timeout = int(self.fps/5)
|
self.keypress_timeout = int(self.fps/5)
|
||||||
if keys[pygame.K_m]:
|
if keys[pygame.K_m]:
|
||||||
self.draw_entities = not self.draw_entities
|
self.draw_entities = not self.draw_entities
|
||||||
|
elif keys[pygame.K_c]:
|
||||||
|
self.draw_confidence_ellipse = not self.draw_confidence_ellipse
|
||||||
elif keys[pygame.K_r]:
|
elif keys[pygame.K_r]:
|
||||||
self.reset()
|
self.reset()
|
||||||
elif keys[pygame.K_p]:
|
elif keys[pygame.K_p]:
|
||||||
|
Loading…
Reference in New Issue
Block a user