I apologize that this is probably a julia question, but...
I've written the following code the intent of which is to make a somewhat more sophisticated player than this, but starting with something simple:
using AZ_Reversi # my reversi game interface
using AlphaZero
using AlphaZero.GI
struct RandomPlayer <: AbstractPlayer end
function select_move(::RandomPlayer, game, turn)
rand(GI.available_actions(game))
end
experiment = Reversi.Training.experiment
session = Session(experiment)
interactive!(session.env.gspec, RandomPlayer(), AlphaZeroPlayer(session))
The problem is that when I run this, it doesn't invoke the RandomPlayer version of select_move.
Debugging, I put a breakpoint in this method:
function select_move(p::TwoPlayers, game, turn)
if GI.white_playing(game)
return select_move(p.white, game, turn)
else
return select_move(p.black, game, turn)
end
end
Looking at p.white it shows RandomPlayer().
When I directly invoke select_move(RandomPlayer(), game, turn) it returns a good value, but when the code runs it invokes the base select_move(::AbstractPlayer, game, turn) version.
My julia isn't that strong, so I'm sure I'm doing something wrong but I can't see what.
I apologize that this is probably a julia question, but...
I've written the following code the intent of which is to make a somewhat more sophisticated player than this, but starting with something simple:
The problem is that when I run this, it doesn't invoke the RandomPlayer version of select_move.
Debugging, I put a breakpoint in this method:
Looking at p.white it shows RandomPlayer().
When I directly invoke select_move(RandomPlayer(), game, turn) it returns a good value, but when the code runs it invokes the base select_move(::AbstractPlayer, game, turn) version.
My julia isn't that strong, so I'm sure I'm doing something wrong but I can't see what.