skip to main content
Rules Agenda
The agenda is a list of rules eligible to be fired. The user can select whether the list is in order of priority from the highest eligible rule at the top to the lowest eligible rule at the bottom or vice versa.
 
Agenda
The agenda is the prioritized list of rules eligible to be fired at a given time. A rule is taken off the agenda when it fires and added back to the agenda when one of its dependencies gets a new value.
At the start of each timestep, all rules in the ruleset are added to the agenda. This ensures that each rule will be fired at least once before the end of the timestep. When the rules processor is ready to execute a rule, it fires either the highest or lowest priority rule on the agenda (depending on the selection the user has made). After a rule fires, it is removed from the agenda. Whenever any of its dependencies gets a new value, the rule is added back onto the agenda in its appropriate place according to priority. Therefore, rules always fire in the priority order specified by the user.
Note:  Compare the rules agenda with the Simulation dispatch queue: both are lists of items to be processed. The Simulation dispatch queue, however, processes the dispatches in the order in which they were added; whereas the rules agenda processes rules in priority order, independent of the order in which they were added to the agenda.
Example 2.3   
Consider a ruleset with five rules, numbered 1 through 5. The user has selected the option to execute the agenda in descending priority order (i.e. 1, 2, 3, ... ). After the start of the first timestep, three rules are executed and finish ineffectually. The next rule to be executed finishes successfully. During the ensuing dispatch, one of rule #2’s dependent slots gets a new value, so rule #2 is put back on the agenda.
What rules are now on the agenda? What is the minimum number of rules which will fire before the end of the timestep? What is the maximum?
Answers:
• After the start of the timestep, the agenda is: #1, #2, #3, #4, #5.
• After three rules are executed ineffectually, the agenda is: #4, #5.
• After the next rule executes successfully, the agenda is: #5.
• After the dispatch changes a dependency of rule #2, the agenda is: #2, #5.
• At least two rules (#2 and #5) must fire before the end of the timestep.
• The maximum number of rules which will fire cannot be determined.
Revised: 07/17/2020