Class RETETerminal

All Implemented Interfaces:
RETENode, RETESinkNode

public class RETETerminal extends Object implements RETESinkNode
The final node in a RETE graph. It runs the builtin guard clauses and then, if the token passes, executes the head operations.
  • Constructor Details

    • RETETerminal

      public RETETerminal(Rule rule, RETEEngine engine, ForwardRuleInfGraphI graph)
      rule - the rule which this terminal should fire.
      engine - the parent rule engine through which the deductions and recursive network can be reached.
      graph - the wider encompassing infGraph needed to for the RuleContext
  • Method Details

    • setContext

      public void setContext(RETEEngine engine, ForwardRuleInfGraphI graph)
      Change the engine/graph to which this terminal should deliver its results.
    • fire

      public void fire(BindingVector env, boolean isAdd)
      Propagate a token to this node.
      Specified by:
      fire in interface RETESinkNode
      env - a set of variable bindings for the rule being processed.
      isAdd - distinguishes between add and remove operations.
    • clone

      public RETENode clone(Map<RETENode,RETENode> netCopy, RETERuleContext contextIn)
      Clone this node in the network.
      Specified by:
      clone in interface RETENode
      netCopy - a map from RETENode to cloned instance
      contextIn - the new context to which the network is being ported