RasmusBrostroem / ConnectFourRL

0 stars 0 forks source link

is_done and evaluate functions in game for the step function in environment #3

Closed RasmusBrostroem closed 2 years ago

RasmusBrostroem commented 2 years ago

Currently the step function in the custom environment is missing the is_done and evaluate functions from the game, but these cant be made until the winning_move function and the is_tie function is made so they take an action as input. This is because the is_legal function needs to know which column to the player wants to place the piece in and if we change the game state, then we cant check for legal move anymore, since that move might have used the last row in that column or have been an illegal move.

jbirkesteen commented 2 years ago

Pseudocode for suggested change in CustomEnv.step():

  1. bool is_legal holds whether or not action on current board is legal
  2. place_piece such that we get future state
  3. calculate reward(take is_legal as input),
  4. is_done(take is_legal as input), check winning/tieing move