protected virtual Reward Playout(WorldModel initialPlayoutState) { FutureStateWorldModel currentState = initialPlayoutState.GenerateChildWorldModel() as FutureStateWorldModel; GOB.Action randomAction; int currentDepth = 0; while (!currentState.IsTerminal()) { randomAction = currentState.getNextRandomAction(this.RandomGenerator); randomAction.ApplyActionEffects(currentState); currentState.CalculateNextPlayer(); currentDepth++; } if (currentDepth > this.MaxPlayoutDepthReached) { this.MaxPlayoutDepthReached = currentDepth; } return(new Reward() { PlayerID = currentState.GetNextPlayer(), Value = currentState.GetScore() }); }