(self, g, node=None, node_parent=None)
return newnode
Copy the current contents GTreeBase to 'g'

      :param g: the destination GTreeBase tree

      .. note:: If you are planning to create a new chromosome representation, you
                **must** implement this method on your class.
Copy the current contents GTreeBase to 'g'
Copy the current contents GTreeBase to g
def copy(self, g, node=None, node_parent=None):
      """ Copy the current contents GTreeBase to 'g'

      :param g: the destination GTreeBase tree

      .. note:: If you are planning to create a new chromosome representation, you
                **must** implement this method on your class.
      """
      if node is None:
         g.tree_height = self.tree_height
         node = self.root_node

      if node is None:
         return None

      newnode = node.clone()

      if node_parent is None:
         g.setRoot(newnode)
      else:
         newnode.setParent(node_parent)
         node_parent.replaceChild(node, newnode)

      for ci in xrange(len(newnode)):
         GTreeBase.copy(self, g, newnode.getChild(ci), newnode)

      return newnode
def copy ( self , g , node = None , node_parent = None ) : if node is None : g . tree_height = self . tree_height node = self . root_node if node is None : return None newnode = node . clone ( ) if node_parent is None : g . setRoot ( newnode ) else : newnode . setParent ( node_parent ) node_parent . replaceChild ( node , newnode ) for ci in xrange ( len ( newnode ) ) : GTreeBase . copy ( self , g , newnode . getChild ( ci ) , newnode ) return newnode