|
ReteEngine 1.0
A rules engine and builder
|
Represents a node in a Rete network that forwards facts to multiple successor nodes, effectively implementing a logical OR branch. More...
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. | |
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.
| void ReteCore.OrNode.AddSuccessor | ( | IReteNode | node | ) |
Adds the specified node as a successor to this node in the Rete network.
| node | The node to add as a successor. Cannot be null. |
| 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.
| fact | The fact object to be asserted and passed to successor nodes. Cannot be null. |
Implements ReteCore.IReteNode.
| 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.
| fact | The fact object to include in the debug output. Can be any object; its string representation will be printed. |
| level | The indentation level to apply to the debug message. Each level increases indentation by spaces. Defaults to 0. |
Implements ReteCore.IReteNode.
| 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.
| fact | The fact object whose property is being refreshed. Cannot be null. |
| prop | The name of the property to refresh. Cannot be null or empty. |
Implements ReteCore.IReteNode.
| 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.
| fact | The fact object to retract. Cannot be null. |
Implements ReteCore.IReteNode.