Beispiel #1
0
 def left_activation(self, t, w, binding=None):
     """
     :type w: rete.WME
     :type t: rete.Token
     :type binding: dict
     """
     new_result = Token(t, w, self, binding)
     owners_t = t
     owners_w = w
     for i in range(self.number_of_conditions):
         owners_w = owners_t.wme
         owners_t = owners_t.parent
     for token in self.ncc_node.memory:
         if token.parent == owners_t and token.wme == owners_w:
             token.ncc_results.append(new_result)
             new_result.owner = token
             Token.delete_token_and_descendants(token)
     self.new_result_buffer.append(new_result)
Beispiel #2
0
    def left_activation(self, t, w, binding=None):
        """
		:type w: rete.WME
		:type t: rete.Token
		:type binding: dict
		"""
        DEBUG("NCC partner left-activate, wme = ", w)
        new_result = Token(t, w, self, binding)
        owners_t = t
        owners_w = w
        for i in range(self.number_of_conditions):
            owners_w = owners_t.wme
            owners_t = owners_t.parent
        found = False
        for token in self.ncc_node.items:
            if token.parent == owners_t and token.wme == owners_w:
                DEBUG("  partner add to ncc_results: ", new_result)
                new_result.owner = token
                token.ncc_results.append(new_result)
                Token.delete_descendents_of_token(token)
                found = True
        if not found:
            # new_result.owner = 'buffed'
            self.new_result_buffer.append(new_result)