| java.lang.Object com.hp.hpl.jena.reasoner.rulesys.impl.RETEConflictSet
RETEConflictSet | public class RETEConflictSet (Code) | | 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.
author: Dave Reynolds version: $Revision: 1.6 $ |
Method Summary | |
public void | add(Rule rule, BindingEnvironment env, boolean isAdd) Record a request for a rule firing. | public static void | execute(RETERuleContext context, boolean isAdd) Execute a single rule firing. | public boolean | fireOne() Pick on pending rule from the conflict set and fire it. | public boolean | isEmpty() Return true if there are no more rules awaiting firing. |
conflictSet | protected ArrayList conflictSet(Code) | | the list of rule activations left to fire
|
isMonotonic | protected boolean isMonotonic(Code) | | false if the overall rule system contains some non-montotonic rules
|
logger | protected static Log logger(Code) | | |
nNeg | protected int nNeg(Code) | | count the number of negative entries - optimization hack
|
nPos | protected int nPos(Code) | | count the number of positive entries - optimization hack
|
RETEConflictSet | public RETEConflictSet(RETERuleContext context, boolean isMonotonic)(Code) | | Construct an empty conflict set, noting whether the overall rule system is monotonic or not
|
add | public void add(Rule rule, BindingEnvironment env, boolean isAdd)(Code) | | Record a request for a rule firing. For monotonic rulesets it may be
actioned immediately, otherwise it will be stacked up.
|
execute | public static void execute(RETERuleContext context, boolean isAdd)(Code) | | Execute a single rule firing.
|
fireOne | public boolean fireOne()(Code) | | Pick on pending rule from the conflict set and fire it.
Return true if there was a rule to fire.
|
isEmpty | public boolean isEmpty()(Code) | | Return true if there are no more rules awaiting firing.
|
|
|