- refactored learning function
- remove state_last, use state instead - added episode history
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user