def _doTournament(self, pop1, pop2, tournamentSize=None):
        """ Play a tournament.

        :key tournamentSize: If unspecified, play all-against-all
        """
        # TODO: Preferably select high-performing opponents?
        for p in pop1:
            pop3 = pop2[:]
            while p in pop3:
                pop3.remove(p)
            if tournamentSize != None and tournamentSize < len(pop3):
                opps = sample(pop3, tournamentSize)
            else:
                opps = pop3
            for opp in opps:
                self._relEval(p, opp)
                self._relEval(opp, p)
dataset/ETHPy150Open pybrain/pybrain/pybrain/optimization/populationbased/coevolution/coevolution.py/Coevolution._doTournament/original