ReteEngine 1.0
A rules engine and builder
Loading...
Searching...
No Matches
ReteCore.Agenda Class Reference

The Agenda class manages pending rule activations in a Rete-based rule engine. It maintains a list of activations that have been triggered but not yet executed. More...

Public Member Functions

void Add (Activation a)
 Adds a new activation to the agenda. This method is typically called when a rule's conditions are satisfied, creating an activation that represents the pending execution of that rule. The activation is added to the list of pending activations, which will be processed later during the firing phase.
void RemoveByFact (object fact)
 Removes any pending activations from the agenda that are associated with the specified fact. This is typically called when a fact is retracted from the working memory, ensuring that any rules that were triggered by that fact but have not yet fired are cancelled and will not execute based on outdated information.
void FireAll ()
 Fires all pending activations in the agenda, executing their associated actions in order of descending salience (priority). After firing, the activations are removed from the agenda. This method is typically called during the rule execution phase to process all activated rules based on their priority, ensuring that higher salience rules are executed before lower salience ones when multiple activations are present.

Properties

bool HasActivations [get]
 Does the agenda currently have any pending activations? This property returns true if there are one or more activations in the agenda, indicating that there are rules that have been triggered and are waiting to be fired. If this property returns false, it means that there are no pending activations and the agenda is currently empty.

Detailed Description

The Agenda class manages pending rule activations in a Rete-based rule engine. It maintains a list of activations that have been triggered but not yet executed.

Member Function Documentation

◆ Add()

void ReteCore.Agenda.Add ( Activation a)

Adds a new activation to the agenda. This method is typically called when a rule's conditions are satisfied, creating an activation that represents the pending execution of that rule. The activation is added to the list of pending activations, which will be processed later during the firing phase.

Parameters
aThe Activation object to add to the list of activations.

◆ RemoveByFact()

void ReteCore.Agenda.RemoveByFact ( object fact)

Removes any pending activations from the agenda that are associated with the specified fact. This is typically called when a fact is retracted from the working memory, ensuring that any rules that were triggered by that fact but have not yet fired are cancelled and will not execute based on outdated information.

Parameters
factThe fact object to remove.

The documentation for this class was generated from the following file:
  • ReteCore/Agenda.cs