- refactored learning function

- remove state_last, use state instead
- added episode history
This commit is contained in:
2024-06-11 09:00:41 +02:00
parent 73f59f25fc
commit 53e4d91ff8
4 changed files with 47 additions and 28 deletions
+4 -4
View File
@@ -43,14 +43,14 @@ def play(player_provider: PlayerProvider, k_max=10000, with_debug=False):
if not has_moved:
if with_debug:
print(f"{player.mark}: No more moves")
player.reward(0.0)
other_player.reward(0.0)
player.end_game(0.0)
other_player.end_game(0.0)
run = False
if player.has_won(state):
if with_debug:
print(f"{player.mark}: Has won the game")
player.reward(1.0)
other_player.reward(0.0)
player.end_game(1.0)
other_player.end_game(0.0)
run = False
other_player = player