(self, other)
return 0
This method will compare the currently tree with another one

        :param other: the other GTreeGP to compare
This method will compare the currently tree with another one
This method will compare the currently tree with another one
def compare(self, other):
        """ This method will compare the currently tree with another one

        :param other: the other GTreeGP to compare
        """
        if not isinstance(other, GTreeGP):
            Util.raiseException("The other tree used to compare is not a GTreeGP class", TypeError)

        stack_self = []
        stack_other = []

        stack_self.append(self.getRoot())
        stack_other.append(other.getRoot())

        while len(stack_self) > 0:

            if (len(stack_self) <= 0) or (len(stack_other) <= 0):
                return -1

            tmp_self, tmp_other = stack_self.pop(), stack_other.pop()
            if tmp_self.compare(tmp_other) != 0:
                return -1

            stack_self.extend(tmp_self.getChilds())
            stack_other.extend(tmp_other.getChilds())

        return 0
def compare ( self , other ) : if not isinstance ( other , GTreeGP ) : Util . raiseException ( "The other tree used to compare is not a GTreeGP class" , TypeError ) stack_self = [ ] stack_other = [ ] stack_self . append ( self . getRoot ( ) ) stack_other . append ( other . getRoot ( ) ) while len ( stack_self ) > 0 : if ( len ( stack_self ) <= 0 ) or ( len ( stack_other ) <= 0 ) : return - 1 tmp_self , tmp_other = stack_self . pop ( ) , stack_other . pop ( ) if tmp_self . compare ( tmp_other ) != 0 : return - 1 stack_self . extend ( tmp_self . getChilds ( ) ) stack_other . extend ( tmp_other . getChilds ( ) ) return 0