ReteEngine 1.0
A rules engine and builder
Loading...
Searching...
No Matches
ReteCore.IReteNode Interface Reference

An interface representing a node in a Rete network, which is responsible for processing facts and propagating them through the network. More...

Inheritance diagram for ReteCore.IReteNode:
ReteCore.AlphaConditionNode< T > ReteCore.AlphaMemory ReteCore.BetaMemory ReteCore.CompositeBetaMemory ReteCore.ExistsNode ReteCore.IndexedExistsNode ReteCore.JoinNode ReteCore.NotNode ReteCore.OrNode ReteCore.TerminalNode ReteProgram.AlphaToBetaAdapter ReteProgram.ReteEngine.TraceNode

Public Member Functions

void Assert (object fact)
 Asserts a fact into the Rete node, which may trigger the propagation of the fact to successor nodes. The specific behavior of this method depends on the type of node (e.g., AlphaMemory, BetaMemory, etc.) and how it processes incoming facts. For example, an AlphaMemory might simply store the fact and propagate it to successors, while a BetaMemory might combine it with existing tokens to create new matches. The Assert method is a fundamental part of how facts are introduced into the Rete network and how they flow through it to trigger rule activations.
void Retract (object fact)
 Retracts a fact from the Rete node, which may trigger the removal of the fact from successor nodes. The specific behavior of this method depends on the type of node and how it manages its internal state. For example, an AlphaMemory might remove the fact from its collection and propagate the retraction to successors, while a BetaMemory might remove any tokens that contain the retracted fact and propagate those changes. The Retract method is essential for maintaining the consistency of the Rete network as facts change over time, allowing it to correctly reflect the current state of knowledge and trigger or deactivate rules as needed.
void Refresh (object fact, string propertyName)
 Refreshes a fact in the Rete node, which may trigger re-evaluation of the fact and its propagation to successor nodes if necessary. This method is typically called when a property of a fact changes, and it allows the Rete network to update its state based on the new information. The specific behavior of this method depends on the type of node and how it manages its internal state. For example, an AlphaMemory might check if the changed property is relevant to its conditions and re-evaluate the fact accordingly, while a BetaMemory might need to re-evaluate any tokens that contain the changed fact. The Refresh method is crucial for ensuring that the Rete network remains accurate and responsive to changes in facts over time.
void DebugPrint (object fact, int level=0)
 Visualizes the current state of the Rete node for debugging purposes. This method can be implemented to print out the internal state of the node, such as the facts it currently holds, the tokens it has generated, or any other relevant information that would help a developer understand how the node is processing facts. The level parameter can be used to indicate the depth in the network or to control the amount of detail printed, allowing for a more structured and readable output when visualizing complex Rete networks.

Detailed Description

An interface representing a node in a Rete network, which is responsible for processing facts and propagating them through the network.

Member Function Documentation

◆ Assert()

void ReteCore.IReteNode.Assert ( object fact)

Asserts a fact into the Rete node, which may trigger the propagation of the fact to successor nodes. The specific behavior of this method depends on the type of node (e.g., AlphaMemory, BetaMemory, etc.) and how it processes incoming facts. For example, an AlphaMemory might simply store the fact and propagate it to successors, while a BetaMemory might combine it with existing tokens to create new matches. The Assert method is a fundamental part of how facts are introduced into the Rete network and how they flow through it to trigger rule activations.

Parameters
fact

Implemented in ReteCore.AlphaConditionNode< T >, ReteCore.AlphaMemory, ReteCore.BetaMemory, ReteCore.CompositeBetaMemory, ReteCore.ExistsNode, ReteCore.IndexedExistsNode, ReteCore.JoinNode, ReteCore.NotNode, ReteCore.OrNode, ReteCore.TerminalNode, ReteProgram.AlphaToBetaAdapter, and ReteProgram.ReteEngine.TraceNode.

◆ DebugPrint()

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

Visualizes the current state of the Rete node for debugging purposes. This method can be implemented to print out the internal state of the node, such as the facts it currently holds, the tokens it has generated, or any other relevant information that would help a developer understand how the node is processing facts. The level parameter can be used to indicate the depth in the network or to control the amount of detail printed, allowing for a more structured and readable output when visualizing complex Rete networks.

Parameters
fact
level

Implemented in ReteCore.AlphaConditionNode< T >, ReteCore.AlphaMemory, ReteCore.BetaMemory, ReteCore.CompositeBetaMemory, ReteCore.ExistsNode, ReteCore.IndexedExistsNode, ReteCore.JoinNode, ReteCore.NotNode, ReteCore.OrNode, ReteCore.TerminalNode, ReteProgram.AlphaToBetaAdapter, and ReteProgram.ReteEngine.TraceNode.

◆ Refresh()

void ReteCore.IReteNode.Refresh ( object fact,
string propertyName )

Refreshes a fact in the Rete node, which may trigger re-evaluation of the fact and its propagation to successor nodes if necessary. This method is typically called when a property of a fact changes, and it allows the Rete network to update its state based on the new information. The specific behavior of this method depends on the type of node and how it manages its internal state. For example, an AlphaMemory might check if the changed property is relevant to its conditions and re-evaluate the fact accordingly, while a BetaMemory might need to re-evaluate any tokens that contain the changed fact. The Refresh method is crucial for ensuring that the Rete network remains accurate and responsive to changes in facts over time.

Parameters
fact
propertyName

Implemented in ReteCore.AlphaConditionNode< T >, ReteCore.AlphaMemory, ReteCore.BetaMemory, ReteCore.CompositeBetaMemory, ReteCore.ExistsNode, ReteCore.IndexedExistsNode, ReteCore.JoinNode, ReteCore.NotNode, ReteCore.OrNode, ReteCore.TerminalNode, ReteProgram.AlphaToBetaAdapter, and ReteProgram.ReteEngine.TraceNode.

◆ Retract()

void ReteCore.IReteNode.Retract ( object fact)

Retracts a fact from the Rete node, which may trigger the removal of the fact from successor nodes. The specific behavior of this method depends on the type of node and how it manages its internal state. For example, an AlphaMemory might remove the fact from its collection and propagate the retraction to successors, while a BetaMemory might remove any tokens that contain the retracted fact and propagate those changes. The Retract method is essential for maintaining the consistency of the Rete network as facts change over time, allowing it to correctly reflect the current state of knowledge and trigger or deactivate rules as needed.

Parameters
fact

Implemented in ReteCore.AlphaConditionNode< T >, ReteCore.AlphaMemory, ReteCore.BetaMemory, ReteCore.CompositeBetaMemory, ReteCore.ExistsNode, ReteCore.IndexedExistsNode, ReteCore.JoinNode, ReteCore.NotNode, ReteCore.OrNode, ReteCore.TerminalNode, ReteProgram.AlphaToBetaAdapter, and ReteProgram.ReteEngine.TraceNode.


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