Class RETEConflictSet


  • public class RETEConflictSet
    extends java.lang.Object
    Manages a set of ready-to-fire rules. For monotonic rule sets we simply fire the rules as soon as they are triggered. For non-monotonic rule sets we stack them up in a conflict set and fire them one-at-a-time, propagating all changes between times.

    Note, implementation is not thread-safe. Would be easy to make it so but concurrent adds to InfModel are not supported anyway.

    • Constructor Summary

      Constructors 
      Constructor Description
      RETEConflictSet​(RETERuleContext context, boolean isMonotonic)
      Construct an empty conflict set, noting whether the overall rule system is monotonic or not
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Rule rule, BindingEnvironment env, boolean isAdd)
      Record a request for a rule firing.
      static void execute​(RETERuleContext context, boolean isAdd)
      Execute a single rule firing.
      boolean fireOne()
      Pick on pending rule from the conflict set and fire it.
      boolean isEmpty()
      Return true if there are no more rules awaiting firing.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RETEConflictSet

        public RETEConflictSet​(RETERuleContext context,
                               boolean isMonotonic)
        Construct an empty conflict set, noting whether the overall rule system is monotonic or not
    • Method Detail

      • add

        public void add​(Rule rule,
                        BindingEnvironment env,
                        boolean isAdd)
        Record a request for a rule firing. For monotonic rulesets it may be actioned immediately, otherwise it will be stacked up.
      • isEmpty

        public boolean isEmpty()
        Return true if there are no more rules awaiting firing.
      • fireOne

        public boolean fireOne()
        Pick on pending rule from the conflict set and fire it. Return true if there was a rule to fire.
      • execute

        public static void execute​(RETERuleContext context,
                                   boolean isAdd)
        Execute a single rule firing.