Skip to content

Commit

Permalink
détail
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsalm committed May 13, 2024
1 parent 6632437 commit f7ad6ef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
Binary file modified __pycache__/visualize.cpython-312.pyc
Binary file not shown.
20 changes: 17 additions & 3 deletions env.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,31 @@ def reward(self, state, action):
return r

# test the environment and visualize the results
'''env = Env()
env = Env()
print(env.reset())
indices = [[0, 10000, 0]]
for i in range(70):
if i%20 >= 10:
a = 1
else:
a = -1
state, r, ok = env.step([0.1, -0.2, 0.01, 0.1])
indices.append([state[0], state[1], state[2]])
for i in range(30):
if i%20 >= 10:
a = 1
else:
a = -1
state, r, ok = env.step([0, 0.1, 0., -0.1])
indices.append([state[0], state[1], state[2]])
for i in range(100):
if i%20 >= 10:
a = 1
else:
a = -1
state, r, ok = env.step([0.2, 0.2, a*0.1, 0.1])
state, r, ok = env.step([-0.2, 0.4, -0.1, 0.])
indices.append([state[0], state[1], state[2]])

vis.visualize(indices)'''
vis.visualize(indices)


Binary file added vaisseau.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
EARTH_GREEN = (0, 128, 0)

# Chargement de l'image du vaisseau
vaisseau_original = pygame.image.load("spacecraft.png")
vaisseau_original = pygame.image.load("vaisseau.png")
vaisseau_original_rect = vaisseau_original.get_rect()
# Redimensionnement de l'image du vaisseau
vaisseau_width = 30
vaisseau_height = 20
vaisseau_width = 40
vaisseau_height = 30
vaisseau_image = pygame.transform.scale(vaisseau_original, (vaisseau_width, vaisseau_height))
vaisseau_rect = vaisseau_image.get_rect()

# Coordonnées du point sur la droite
point_x = 650
point_y = 300
point_y = 315

def draw_circle(screen):
pygame.draw.circle(screen, BROWN, (650, point_y), 15)
Expand Down

0 comments on commit f7ad6ef

Please sign in to comment.