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

Represents a node in a Rete network that forwards facts to multiple successor nodes, effectively implementing a logical OR branch. More...

Inheritance diagram for ReteCore.OrNode:
ReteCore.IReteNode

Public Member Functions

void AddSuccessor (IReteNode node)
 Adds the specified node as a successor to this node in the Rete network.
void Assert (object fact)
 Propagates the specified fact to all successor nodes for further processing.
void Retract (object fact)
 Retracts the specified fact from the rule engine, removing it from further consideration in rule evaluation.
void Refresh (object fact, string prop)
 Propagates a refresh operation for the specified fact and property to all successor nodes.
void DebugPrint (object fact, int level=0)
 Writes a formatted debug message to the console that includes the specified fact and the current number of successors.

Detailed Description

Represents a node in a Rete network that forwards facts to multiple successor nodes, effectively implementing a logical OR branch.

The OrNode is typically used within a Rete-based rule engine to allow a fact to be propagated to several alternative branches in the network. When a fact is asserted, retracted, or refreshed, the operation is forwarded to all successor nodes. This enables rules that require matching on any of several conditions to be efficiently represented. The OrNode does not perform any filtering or transformation of facts; it simply passes them through to its successors.

Member Function Documentation

◆ AddSuccessor()

void ReteCore.OrNode.AddSuccessor ( IReteNode node)

Adds the specified node as a successor to this node in the Rete network.

Parameters
nodeThe node to add as a successor. Cannot be null.

◆ Assert()

void ReteCore.OrNode.Assert ( object fact)

Propagates the specified fact to all successor nodes for further processing.

This method forwards the provided fact to each successor node in the current node's collection. The fact is not modified by this method.

Parameters
factThe fact object to be asserted and passed to successor nodes. Cannot be null.

Implements ReteCore.IReteNode.

◆ DebugPrint()

void ReteCore.OrNode.DebugPrint ( object fact,
int level = 0 )

Writes a formatted debug message to the console that includes the specified fact and the current number of successors.

Parameters
factThe fact object to include in the debug output. Can be any object; its string representation will be printed.
levelThe indentation level to apply to the debug message. Each level increases indentation by spaces. Defaults to 0.

Implements ReteCore.IReteNode.

◆ Refresh()

void ReteCore.OrNode.Refresh ( object fact,
string prop )

Propagates a refresh operation for the specified fact and property to all successor nodes.

Use this method to notify all successor nodes that a particular property of a fact has changed and may require re-evaluation. This method does not perform any refresh logic itself but delegates the operation to its successors.

Parameters
factThe fact object whose property is being refreshed. Cannot be null.
propThe name of the property to refresh. Cannot be null or empty.

Implements ReteCore.IReteNode.

◆ Retract()

void ReteCore.OrNode.Retract ( object fact)

Retracts the specified fact from the rule engine, removing it from further consideration in rule evaluation.

If the specified fact is not currently asserted, this method has no effect. Retracting a fact may cause dependent rules to be reevaluated or deactivated.

Parameters
factThe fact object to retract. Cannot be null.

Implements ReteCore.IReteNode.


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