def __init__(self, size=10, cloning=False): """ The initializator of G1DList representation, size parameter must be specified """ G1DBase.__init__(self, size) if not cloning: self.initializator.set(CDefG1DListInit) self.mutator.set(CDefG1DListMutator) self.crossover.set(CDefG1DListCrossover)
def copy(self, g): """ Copy genome to 'g' Example: >>> genome_origin.copy(genome_destination) :param g: the destination G1DList instance """ #GenomeBase.copy(self, g) G1DBase.copy(self, g)
def __repr__(self): """ Return a string representation of Genome """ ret = G1DBase.__repr__(self) ret += "- G1DList\n" ret += "\tList size:\t %s\n" % (self.get_list_size(),) ret += "\tList:\t\t %s\n\n" % (self.genomeList,) return ret