Example #1
0
    def __init__(self, name = None, root = None):
        """Initialize.

        name    --  A name for this Equation.
        root    --  The root node of the Literal tree (default None). If root
                    is not passed here, you must call the 'setRoot' method to
                    set or change the root node.

        """
        # Operator stuff. We circumvent Operator.__init__ since we're using
        # args as a property. We cannot set it, as the Operator tries to do.
        if name is None and root is not None:
            name = "eq_%s"%root.name
        Literal.__init__(self, name)
        self.symbol = name
        self.nin = None
        self.nout = 1
        self.operation = self.__call__

        self.root = None
        self.argdict = OrderedDict()
        if root is not None:
            self.setRoot(root)

        return
Example #2
0
    def __init__(self, name=None, root=None):
        """Initialize.

        name    --  A name for this Equation.
        root    --  The root node of the Literal tree (default None). If root
                    is not passed here, you must call the 'setRoot' method to
                    set or change the root node.

        """
        # Operator stuff. We circumvent Operator.__init__ since we're using
        # args as a property. We cannot set it, as the Operator tries to do.
        if name is None and root is not None:
            name = "eq_%s" % root.name
        Literal.__init__(self, name)
        self.symbol = name
        self.nin = None
        self.nout = 1
        self.operation = self.__call__

        self.root = None
        self.argdict = OrderedDict()
        if root is not None:
            self.setRoot(root)

        return
Example #3
0
 def __init__(self, name = None, symbol = None, operation = None, nin = 2,
         nout = 1):
     """Initialization."""
     Literal.__init__(self, name)
     self.symbol = symbol
     self.nin = nin
     self.nout = nout
     self.args = []
     self.operation = operation
     return
Example #4
0
 def __init__(self, name = None, value = None, const = False):
     """Initialization."""
     Literal.__init__(self, name)
     self.const = const
     self.value = value
     return
Example #5
0
 def __init__(self, name=None, value=None, const=False):
     """Initialization."""
     Literal.__init__(self, name)
     self.const = const
     self.value = value
     return