- fixed human player
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ class HumanPlayer(APlayer):
|
|||||||
state_next = self.to_state(state.copy(), move)
|
state_next = self.to_state(state.copy(), move)
|
||||||
return state_next, has_moved
|
return state_next, has_moved
|
||||||
|
|
||||||
def end_game(self, value):
|
def end_game(self, value, state: np.array):
|
||||||
if value > 0:
|
if value > 0:
|
||||||
print(f"{self.name}, Du hast gewonnen, super!")
|
print(f"{self.name}, Du hast gewonnen, super!")
|
||||||
else:
|
else:
|
||||||
|
|||||||
+3
-3
@@ -79,11 +79,11 @@ else:
|
|||||||
o_values = {}
|
o_values = {}
|
||||||
|
|
||||||
p_hx = HumanPlayer(mark='X', name="Jens")
|
p_hx = HumanPlayer(mark='X', name="Jens")
|
||||||
p_mx = MachinePlayer(mark='X', params=MachinePlayer.Params(p_explore=0.2, alpha=0.1), values=x_values)
|
p_mx = MachinePlayer(mark='X', params=MachinePlayer.Params(p_explore=0.1, alpha=0.1), values=x_values)
|
||||||
p_mo = MachinePlayer(mark='O', params=MachinePlayer.Params(p_explore=0.2, alpha=0.1), values=o_values)
|
p_mo = MachinePlayer(mark='O', params=MachinePlayer.Params(p_explore=0.1, alpha=0.1), values=o_values)
|
||||||
|
|
||||||
if do_training:
|
if do_training:
|
||||||
play(PlayerProvider(p_mx, p_mo), 5000, True)
|
play(PlayerProvider(p_mx, p_mo), 50000, False)
|
||||||
|
|
||||||
# Values after training
|
# Values after training
|
||||||
# Convert and write JSON object to file
|
# Convert and write JSON object to file
|
||||||
|
|||||||
Reference in New Issue
Block a user