You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defiterateGameStep(ticTacToeWorld : TicTacToeWorld, epsilon : Double, frame : Option[JFrame], collectingDataFor : String) :Double= { // If you're collecting data, pass in the string "X" or "O" for the player whose data you're interested in. This method returns 1 if that player won this episode, -1 if it lost, 0 if it was a stalemate, and -2 if the episode hasn't ended.
/** The environment calls this to reward the agent for its action. */
339
342
defreward(reward : Double) {
340
343
if (movedOnce ==true&& random ==false) {
344
+
if (newlyOccupiedSpace ==0) {
345
+
thrownewInvalidCall(s"An attempt was made to give reward to ${name} while its previous action is ${newlyOccupiedSpace}. A player must move at least once to be rewarded for it.")
346
+
}
341
347
debugPrint(s"Give reward ${reward} to ${name} moving from ${previousState} to ${state}")
0 commit comments