engine.rete.agenda

Agenda scheduling and conflict resolution for RETE rule activations.

Classes

AgendaEntry

Sortable agenda entry implementing conflict-resolution priorities.

Agenda

Central scheduler for rule activations.

Module Contents

class engine.rete.agenda.AgendaEntry

Sortable agenda entry implementing conflict-resolution priorities.

salience_rank: int
depth_rank: int
insertion_rank: int
action: engine.rete.consequents.ActionInstance
class engine.rete.agenda.Agenda(actions: collections.abc.Iterable[engine.rete.consequents.ActionInstance] = ())

Central scheduler for rule activations.

The agenda applies conflict resolution using user-defined salience first, then breadth-first inference depth, while preserving stable insertion order among otherwise equivalent activations.

enqueue(action: engine.rete.consequents.ActionInstance) → None

Add action to the agenda using conflict-resolution ordering.

extend(actions: collections.abc.Iterable[engine.rete.consequents.ActionInstance]) → None

Enqueue every action in actions.

pop() → engine.rete.consequents.ActionInstance

Remove and return the highest-priority scheduled action.

drain() → tuple[engine.rete.consequents.ActionInstance, Ellipsis]

Pop all scheduled actions in priority order.