@Override
    public void computeFitness() {

        this.fitness = 0.0; 

        AiInterface opponent = MinichessBeatRandCreature.globalRandomAi; 
        boolean playAsWhite = GPConfig.getRandGen().nextBoolean(); 
        int numOpponents = GPConfig.getTournySize() - 1; 

        for (int i = 0; i < numOpponents; i++) {

            COLOR winner = null;
            if (playAsWhite) {
                winner = SimplePlay.playGame(this.myMinichessAi, opponent); 
            }
            else {
                winner = SimplePlay.playGame(opponent, this.myMinichessAi); 
            }

            if (winner == null)
                continue;
            else if (playAsWhite && winner==COLOR.WHITE)
                fitness+=1.0; 
            else if (!playAsWhite && winner == COLOR.BLACK)
                fitness+=1.0; 
            else
                fitness-=1.0; 

        }

        this.p_isFitnessValid = true; 
    }