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()
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())
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)