コード例 #1
0
 def reset(self):
     """Reset itself and recursively all its children."""
     MATCHER.debug("Node <%s> reset", self)
     self._reset()
     for child in self.children:
         child.node.reset()
コード例 #2
0
 def activate_right(self, token):
     """Make a copy of the received token and call `_activate_right`."""
     MATCHER.debug("Node <%s> activated right with token %r", self, token)
     return self._activate_right(token.copy())
コード例 #3
0
ファイル: nodes.py プロジェクト: fly2mars/TO
 def remove(self, fact):
     """Create an INVALID token and send it to all children."""
     token = Token.invalid(fact)
     MATCHER.debug("<BusNode> added %r", token)
     for child in self.children:
         child.callback(token)