Skip to content
Extraits de code Groupes Projets
Valider b65c8462 rédigé par Adrien Payen's avatar Adrien Payen
Parcourir les fichiers

update files

parent 784ffb63
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
*.pyc *.pyc
*.pyd *.pyd
*.pyo *.pyo
__pycache__ __pycache__
\ No newline at end of file *.DS_Store
\ No newline at end of file
...@@ -90,7 +90,7 @@ def plot_state_based_comparison_once(num_games : int): ...@@ -90,7 +90,7 @@ def plot_state_based_comparison_once(num_games : int):
if __name__ == '__main__': if __name__ == '__main__':
##### Paramètres ##### ##### Parametres #####
# Define the layout of the game board # Define the layout of the game board
layout = [0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 1, 0] layout = [0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 1, 0]
...@@ -98,8 +98,8 @@ if __name__ == '__main__': ...@@ -98,8 +98,8 @@ if __name__ == '__main__':
# All the layout for the comparison # All the layout for the comparison
#classiclayout = [0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 1, 0] #classiclayout = [0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 1, 0]
#layout = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 1, 0] #layout = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 1, 0]
#layouttpslowlane = [0, 0, 3, 0, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0] # layout with a trapped slowlane #layoutslowlanetp = [0, 0, 3, 0, 2, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0] # layout with a trapped slowlane
#layouttpfastlane = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 1, 0] # layout with a trapped fastlane #layoutfastlanetp = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 1, 0] # layout with a trapped fastlane
#zerolayout = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] #zerolayout = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
# Indicates whether the board is circular or linear # Indicates whether the board is circular or linear
......
...@@ -85,7 +85,7 @@ class Validation: ...@@ -85,7 +85,7 @@ class Validation:
total_turns = [] total_turns = []
for _ in range(n_iterations): for _ in range(n_iterations):
state_turns = np.zeros(len(layout) - 1) # Utiliser un tableau numpy pour stocker les tours par état state_turns = np.zeros(len(layout) - 1) # Numpy to store the turns by state
for state in range(len(layout) - 1): for state in range(len(layout) - 1):
k = state k = state
...@@ -103,7 +103,7 @@ class Validation: ...@@ -103,7 +103,7 @@ class Validation:
if layout[k] == 3: if layout[k] == 3:
if action == 2: if action == 2:
turns += np.random.choice([1, 2], p=[0.5, 0.5]) # Utiliser numpy pour la randomisation turns += np.random.choice([1, 2], p=[0.5, 0.5]) # Numpy for randomisation
elif action == 3: elif action == 3:
turns += 2 turns += 2
else: else:
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter