(self)
return ret
The string representation of the GA Engine
The string representation of the GA Engine
The string representation of the GA Engine
def __repr__(self):
        """ The string representation of the GA Engine """
        minimax_type = Consts.minimaxType.keys()[Consts.minimaxType.values().index(self.minimax)]
        ret = "- GSimpleGA\n"
        ret += "\tGP Mode:\t\t %s\n" % self.getGPMode()
        ret += "\tPopulation Size:\t %d\n" % self.internalPop.popSize
        ret += "\tGenerations:\t\t %d\n" % self.nGenerations
        ret += "\tCurrent Generation:\t %d\n" % self.currentGeneration
        ret += "\tMutation Rate:\t\t %.2f\n" % self.pMutation
        ret += "\tCrossover Rate:\t\t %.2f\n" % self.pCrossover
        ret += "\tMinimax Type:\t\t %s\n" % minimax_type.capitalize()
        ret += "\tElitism:\t\t %s\n" % self.elitism
        ret += "\tElitism Replacement:\t %d\n" % self.nElitismReplacement
        ret += "\tDB Adapter:\t\t %s\n" % self.dbAdapter
        for slot in self.allSlots:
            ret += "\t" + slot.__repr__()
        ret += "\n"
        return ret
def __repr__ ( self ) : minimax_type = Consts . minimaxType . keys ( ) [ Consts . minimaxType . values ( ) . index ( self . minimax ) ] ret = "- GSimpleGA\n" ret += "\tGP Mode:\t\t %s\n" % self . getGPMode ( ) ret += "\tPopulation Size:\t %d\n" % self . internalPop . popSize ret += "\tGenerations:\t\t %d\n" % self . nGenerations ret += "\tCurrent Generation:\t %d\n" % self . currentGeneration ret += "\tMutation Rate:\t\t %.2f\n" % self . pMutation ret += "\tCrossover Rate:\t\t %.2f\n" % self . pCrossover ret += "\tMinimax Type:\t\t %s\n" % minimax_type . capitalize ( ) ret += "\tElitism:\t\t %s\n" % self . elitism ret += "\tElitism Replacement:\t %d\n" % self . nElitismReplacement ret += "\tDB Adapter:\t\t %s\n" % self . dbAdapter for slot in self . allSlots : ret += "\t" + slot . __repr__ ( ) ret += "\n" return ret