Esempio n. 1
0
 def __init__(self, rightParent, leftParent):
     """
     Constructor
     """
     JoinNode.__init__(self, rightParent, leftParent, [])
     Memory.__init__(self)
     self._existsCount = 0
Esempio n. 2
0
 def __init__(self, rightParent, leftParent):
     '''
     Constructor
     '''
     JoinNode.__init__(self, rightParent, leftParent, [])
     Memory.__init__(self)
     self._existsCount = 0
Esempio n. 3
0
 def __init__(self, leftParent, rightParent, partnerCircuitLength):
     '''
     Create the new ncc node
     '''
     Node.__init__(self, rightParent=None, leftParent=leftParent)
     Memory.__init__(self)
     
     self._partner = NccPartnerNode(rightParent, partnerCircuitLength, self)
Esempio n. 4
0
    def __init__(self, leftParent, rightParent, partnerCircuitLength):
        '''
        Create the new ncc node
        '''
        Node.__init__(self, rightParent=None, leftParent=leftParent)
        Memory.__init__(self)

        self._partner = NccPartnerNode(rightParent, partnerCircuitLength, self)
Esempio n. 5
0
 def delete(self, notifierRemoval=None, notifierUnlinking=None):
     if self.isMain:
         for linkedNode in self._linkedPNodes:
             linkedNode.delete(notifierRemoval, notifierUnlinking)
             
         self._linkedPNodes = []
         
     Memory.delete(self)
     Node.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 6
0
 def delete(self, notifierRemoval=None, notifierUnlinking=None):
     """
     Remove the beta-memory from the network
     """
     # first delete all tokens
     Memory.delete(self)
         
     # then i can call parent destructor
     Node.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 7
0
    def delete(self, notifierRemoval=None, notifierUnlinking=None):
        """
        Remove the beta-memory from the network
        """
        # first delete all tokens
        Memory.delete(self)

        # then i can call parent destructor
        Node.delete(self, notifierRemoval, notifierUnlinking)
 def delete(self, notifierRemoval=None, notifierUnlinking=None):
     """
     Remove the negative join node from the network
     and delete all tokens created by this node
     """
     # destroy tokens in memory
     Memory.delete(self)
         
     # then i can call parent destructor
     JoinNode.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 9
0
 def delete(self, notifierRemoval=None, notifierUnlinking=None):
     """
     Remove this node and the partner from the network
     """
     # notify unlink between ncc and partner
     #EventManager.trigger(EventManager.E_NODE_UNLINKED, self.get_partner(), self)
     # then destroy the partner
     self.partner.delete(notifierRemoval, notifierUnlinking)
     # and last destroy this node itself
     Memory.delete(self)
     Node.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 10
0
 def delete(self, notifierRemoval=None, notifierUnlinking=None):
     """
     Remove this node and the partner from the network
     """
     # notify unlink between ncc and partner
     #EventManager.trigger(EventManager.E_NODE_UNLINKED, self.get_partner(), self)
     # then destroy the partner
     self.partner.delete(notifierRemoval, notifierUnlinking)
     # and last destroy this node itself
     Memory.delete(self)
     Node.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 11
0
    def delete(self, notifierRemoval=None, notifierUnlinking=None):
        """
        Remove the negative join node from the network
        and delete all tokens created by this node
        """

        for wme in self.rightParent.items:
            wme.unlinkExistsNode(self)

        # destroy tokens in memory
        Memory.delete(self)

        # then i can call parent destructor
        JoinNode.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 12
0
 def delete(self, notifierRemoval=None, notifierUnlinking=None):
     """
     Remove the negative join node from the network
     and delete all tokens created by this node
     """
     
     for wme in self.rightParent.items:
         wme.unlinkExistsNode(self)
     
     # destroy tokens in memory
     Memory.delete(self)
         
     # then i can call parent destructor
     JoinNode.delete(self, notifierRemoval, notifierUnlinking)
Esempio n. 13
0
    def __init__(self, ruleName, leftParent, network, orClauseCount=None, rhs=None, properties=None, moduleName=None, variables=None):
        '''
        Constructor
        '''
        self._ruleName = ruleName + (("~"+str(orClauseCount)) if orClauseCount is not None else "")
        self._isMain = (orClauseCount is None)
        self._network = network
        self._rhs = rhs
        self._linkedPNodes = []
        self._properties = {"salience": 0, "auto-focus": False} if properties is None or not isinstance(properties, dict) else properties
        self._moduleName = moduleName if moduleName is not None else network.modulesManager.currentScope.moduleName
        self._variables = variables if isinstance(variables, dict) else {}

        Node.__init__(self, leftParent=leftParent)
        Memory.__init__(self)
Esempio n. 14
0
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     Node.__init__(self, rightParent=parent, leftParent=None)
     Memory.__init__(self)
Esempio n. 15
0
 def reduceCount(self):
     self._existsCount -= 1
     if self._existsCount == 0:
         Memory.delete(self)
Esempio n. 16
0
 def removeItem(self, item):
     # remove the item from the memory
     Memory.removeItem(self, item)
     # and remove the activation
     self._network.agenda.remove(self, item)
Esempio n. 17
0
 def reduceCount(self):
     self._existsCount -= 1
     if self._existsCount == 0:
         Memory.delete(self)
Esempio n. 18
0
 def __init__(self, rightParent, leftParent, tests=None):
     '''
     Constructor
     '''
     JoinNode.__init__(self, rightParent=rightParent, leftParent=leftParent, tests=tests)
     Memory.__init__(self)
Esempio n. 19
0
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     Node.__init__(self, rightParent=parent, leftParent=None)
     Memory.__init__(self)