Interface ActivationManager

All Superinterfaces:
Predicate<RuntimeRule>

public interface ActivationManager
extends 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 Type Method Description
    default void onActivation​(RuntimeRule rule)
    Deprecated.
    default void onActivation​(RuntimeRule rule, long count)
    This method is called after rule activation.
    default void onAgenda​(int sequenceId, List<RuntimeRule> agenda)
    This method is called once for each memory change and before any rule activations.
    default boolean test​(RuntimeRule rule)  

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Method Details

    • onAgenda

      default void onAgenda​(int sequenceId, List<RuntimeRule> agenda)

      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

      default boolean test​(RuntimeRule rule)
      Specified by:
      test in interface Predicate<RuntimeRule>
      Parameters:
      rule - the rule to be allowed or disallowed for activation
      Returns:
      true if the rule needs to be activated
    • onActivation

      @Deprecated default void onActivation​(RuntimeRule rule)
      Deprecated.
    • onActivation

      default void onActivation​(RuntimeRule rule, long count)
      This method is called after rule activation. Developers use this method to track activation history. this manager's test() method
      Parameters:
      rule - the rule that has been activated
      count - the number of times the rule's RHS part has been called