本文整理汇总了Python中GenomeBase.GenomeBase类的典型用法代码示例。如果您正苦于以下问题:Python GenomeBase类的具体用法?Python GenomeBase怎么用?Python GenomeBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GenomeBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: copy
def copy(self, g):
""" Copy the contents to the destination g
:param g: the GTreeGP genome destination
"""
GenomeBase.copy(self, g)
GTreeBase.copy(self, g)
示例2: __init__
def __init__(self, root_node=None, cloning=False):
GenomeBase.__init__(self)
GTreeBase.__init__(self, root_node)
if not cloning:
self.initializator.set(Consts.CDefGTreeGPInit)
self.mutator.set(Consts.CDefGGTreeGPMutator)
self.crossover.set(Consts.CDefGTreeGPCrossover)
示例3: __init__
def __init__(self, length=10):
""" The initializator of G1DList representation, size parameter must be specified """
GenomeBase.__init__(self)
self.genomeString = []
self.stringLength = length
self.initializator.set(Consts.CDefG1DBinaryStringInit)
self.mutator.set(Consts.CDefG1DBinaryStringMutator)
self.crossover.set(Consts.CDefG1DBinaryStringCrossover)
示例4: __init__
def __init__(self, length=10):
""" The initializator of G1DList representation """
GenomeBase.__init__(self)
G1DBase.__init__(self, length)
self.genomeList = []
self.stringLength = length
self.initializator.set(Consts.CDefG1DBinaryStringInit)
self.mutator.set(Consts.CDefG1DBinaryStringMutator)
self.crossover.set(Consts.CDefG1DBinaryStringCrossover)
示例5: __init__
def __init__(self, size=10, cloning=False):
""" The initializator of G1DList representation,
size parameter must be specified """
GenomeBase.__init__(self)
G1DBase.__init__(self, size)
if not cloning:
self.initializator.set(Consts.CDefG1DListInit)
self.mutator.set(Consts.CDefG1DListMutator)
self.crossover.set(Consts.CDefG1DListCrossover)
示例6: __init__
def __init__(self, size):
""" The initializator of G1DList representation,
size parameter must be specified """
GenomeBase.__init__(self)
self.genomeList = []
self.listSize = size
self.initializator.set(Consts.CDefG1DListInit)
self.mutator.set(Consts.CDefG1DListMutator)
self.crossover.set(Consts.CDefG1DListCrossover)
示例7: copy
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)
示例8: copy
def copy(self, g):
""" Copy genome to 'g'
Example:
>>> genome_origin.copy(genome_destination)
:param g: the destination G1DList instance
"""
GenomeBase.copy(self, g)
g.listSize = self.listSize
g.genomeList = self.genomeList[:]
示例9: copy
def copy(self, g):
""" Copy genome to 'g'
Example:
>>> genome_origin.copy(genome_destination)
:param g: the destination G2DCartesian instance
"""
GenomeBase.copy(self, g)
g.expressionNodes = self.expressionNodes.copy()
g.reevaluate = self.reevaluate
g.nodes = copy.deepcopy(self.nodes)
示例10: copy
def copy(self, g):
""" Copy genome to 'g'
Example:
>>> genome_origin.copy(genome_destination)
:param g: the destination G2DList instance
"""
GenomeBase.copy(self, g)
g.height = self.height
g.width = self.width
for i in xrange(self.height):
g.genomeList[i] = self.genomeList[i][:]
示例11: __init__
def __init__(self, height, width):
""" The initializator of G2DBinaryString representation,
height and width must be specified """
GenomeBase.__init__(self)
self.height = height
self.width = width
self.genomeString = [None] * height
for i in xrange(height):
self.genomeString[i] = [None] * width
self.initializator.set(Consts.CDefG2DBinaryStringInit)
self.mutator.set(Consts.CDefG2DBinaryStringMutator)
self.crossover.set(Consts.CDefG2DBinaryStringCrossover)
示例12: __init__
def __init__(self, height, width, cloning=False):
""" The initializator of G2DList representation,
height and width must be specified """
GenomeBase.__init__(self)
self.height = height
self.width = width
self.genomeList = [None]*height
for i in xrange(height):
self.genomeList[i] = [None] * width
if not cloning:
self.initializator.set(Consts.CDefG2DListInit)
self.mutator.set(Consts.CDefG2DListMutator)
self.crossover.set(Consts.CDefG2DListCrossover)
示例13: __repr__
def __repr__(self):
""" Return a string representation of Genome """
ret = GenomeBase.__repr__(self)
ret += "- G1DList\n"
ret += "\tList size:\t %s\n" % (self.listSize,)
ret += "\tList:\t\t %s\n\n" % (self.genomeList,)
return ret
示例14: __repr__
def __repr__(self):
""" Return a string representation of Genome """
ret = GenomeBase.__repr__(self)
ret += "- G1DBinaryString\n"
ret += "\tString length:\t %s\n" % (self.getListSize(),)
ret += "\tString:\t\t %s\n\n" % (self.getBinary(),)
return ret
示例15: __repr__
def __repr__(self):
""" Return a string representation of Genome """
ret = GenomeBase.__repr__(self)
ret += "- G2DCartesian\n"
ret += "\tList size:\t %s\n" % (len(self.nodes,))
ret += "\tList:\t\t %s\n\n" % (self.nodes,)
return ret