Package org.evrete.api
Interface ActivationManager
- All Superinterfaces:
Predicate<RuntimeRule>
Activation manager controls whether an active rule should really fire based on the history of previous activations. Each session is provided with its own instance of activation manager.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonActivation(RuntimeRule rule, long count) This method is called after rule activation.default voidonAgenda(int sequenceId, List<RuntimeRule> agenda) This method is called once for each memory change and before any rule activations.default booleantest(RuntimeRule rule)
-
Method Details
-
onAgenda
This method is called once for each memory change and before any rule activations. A unique sequence id is supplied as an argument so that developers could distinguish the initial fire and subsequent changes in the working memory caused by RHS calls.
- Parameters:
sequenceId- memory task counter starting at zero (initial session fire)agenda- rules that are activated by current changes in the working memory.
-
test
- Specified by:
testin interfacePredicate<RuntimeRule>- Parameters:
rule- the rule to be allowed or disallowed for activation- Returns:
- true if the rule needs to be activated
-
onActivation
This method is called after rule activation. Developers use this method to track activation history. this manager'stest()method- Parameters:
rule- the rule that has been activatedcount- the number of times the rule's RHS part has been called
-