Adapts an Alpha Memory output (single fact) to a Beta Memory input (Token). This allows the first JoinNode in a chain to receive a Token on its left.
More...
|
| | AlphaToBetaAdapter (BetaMemory betaMemory, string factName) |
| | This constructor initializes a new instance of the AlphaToBetaAdapter class with the specified BetaMemory and fact name. The adapter will take facts asserted into it, wrap them into Tokens with the given fact name, and assert those tokens into the provided BetaMemory. This allows for seamless integration of Alpha Memory outputs into the Beta Memory processing pipeline, enabling the first JoinNode in a rule to receive tokens that represent individual facts from the Alpha Memory.
|
| void | AddSuccessor (IReteNode node) |
| | Adds a successor node to this adapter. In the context of the Rete network, this method is used to connect the output of the adapter (which produces Tokens) to the next node in the network, typically a JoinNode or another BetaMemory. When a fact is asserted into this adapter, it will be wrapped into a Token and then passed to all successor nodes that have been added through this method. This allows the adapter to serve as a bridge between Alpha Memory outputs and the Beta Memory processing that follows in the rule evaluation process.
|
| void | Assert (object fact) |
| | Asserts a fact into the adapter. The fact is wrapped into a Token with the specified fact name and then asserted into the connected BetaMemory. This allows the first JoinNode in the rule network to receive a Token representing the fact from the Alpha Memory, enabling it to participate in the rule evaluation process as if it were a standard token from a BetaMemory. The fact name is used to maintain clarity and consistency in the tokens being processed through the network.
|
| void | Retract (object fact) |
| | Retracts a fact from the adapter. This method will remove any tokens from the connected BetaMemory that contain the specified fact. Since the adapter wraps facts into tokens, it relies on the BetaMemory's Retract method to identify and remove any tokens that include the retracted fact. This ensures that when a fact is retracted, all relevant tokens in the BetaMemory are updated accordingly, allowing successor nodes to adjust their state based on the change in facts.
|
| void | Refresh (object fact, string propertyName) |
| | Refreshes a fact in the adapter. This method will trigger a re-evaluation of any tokens in the connected BetaMemory that contain the specified fact, based on the property that has changed. The adapter relies on the BetaMemory's Refresh method to identify relevant tokens and propagate the refresh to successor nodes, allowing them to re-evaluate their conditions based on the updated information. This is crucial for maintaining the accuracy and responsiveness of the Rete network as facts evolve over time.
|
| void | DebugPrint (object fact, int level=0) |
| | A visual debugging method that prints the fact being processed and the internal state of the connected BetaMemory. This method can be used to trace the flow of facts through the adapter and into the BetaMemory, providing insight into how facts are being wrapped into tokens and how they are being processed by successor nodes. The level parameter can be used to control the indentation of the output for better readability when visualizing complex rule networks.
|
Adapts an Alpha Memory output (single fact) to a Beta Memory input (Token). This allows the first JoinNode in a chain to receive a Token on its left.
◆ AlphaToBetaAdapter()
| ReteProgram.AlphaToBetaAdapter.AlphaToBetaAdapter |
( |
BetaMemory | betaMemory, |
|
|
string | factName ) |
This constructor initializes a new instance of the AlphaToBetaAdapter class with the specified BetaMemory and fact name. The adapter will take facts asserted into it, wrap them into Tokens with the given fact name, and assert those tokens into the provided BetaMemory. This allows for seamless integration of Alpha Memory outputs into the Beta Memory processing pipeline, enabling the first JoinNode in a rule to receive tokens that represent individual facts from the Alpha Memory.
- Parameters
-
| betaMemory | The BetaMemory to add the token and associated fact to |
| factName | The name of the fact |
- Exceptions
-
| ArgumentNullException | Thrown on a null BetaMemory argument |
◆ AddSuccessor()
| void ReteProgram.AlphaToBetaAdapter.AddSuccessor |
( |
IReteNode | node | ) |
|
Adds a successor node to this adapter. In the context of the Rete network, this method is used to connect the output of the adapter (which produces Tokens) to the next node in the network, typically a JoinNode or another BetaMemory. When a fact is asserted into this adapter, it will be wrapped into a Token and then passed to all successor nodes that have been added through this method. This allows the adapter to serve as a bridge between Alpha Memory outputs and the Beta Memory processing that follows in the rule evaluation process.
- Parameters
-
◆ Assert()
| void ReteProgram.AlphaToBetaAdapter.Assert |
( |
object | fact | ) |
|
Asserts a fact into the adapter. The fact is wrapped into a Token with the specified fact name and then asserted into the connected BetaMemory. This allows the first JoinNode in the rule network to receive a Token representing the fact from the Alpha Memory, enabling it to participate in the rule evaluation process as if it were a standard token from a BetaMemory. The fact name is used to maintain clarity and consistency in the tokens being processed through the network.
- Parameters
-
| fact | The fact object to be asserted and passed to successor nodes. Cannot be null. |
Implements ReteCore.IReteNode.
◆ DebugPrint()
| void ReteProgram.AlphaToBetaAdapter.DebugPrint |
( |
object | fact, |
|
|
int | level = 0 ) |
A visual debugging method that prints the fact being processed and the internal state of the connected BetaMemory. This method can be used to trace the flow of facts through the adapter and into the BetaMemory, providing insight into how facts are being wrapped into tokens and how they are being processed by successor nodes. The level parameter can be used to control the indentation of the output for better readability when visualizing complex rule networks.
- Parameters
-
| 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.
◆ Refresh()
| void ReteProgram.AlphaToBetaAdapter.Refresh |
( |
object | fact, |
|
|
string | propertyName ) |
Refreshes a fact in the adapter. This method will trigger a re-evaluation of any tokens in the connected BetaMemory that contain the specified fact, based on the property that has changed. The adapter relies on the BetaMemory's Refresh method to identify relevant tokens and propagate the refresh to successor nodes, allowing them to re-evaluate their conditions based on the updated information. This is crucial for maintaining the accuracy and responsiveness of the Rete network as facts evolve over time.
- Parameters
-
| fact | The fact object whose property is being refreshed. Cannot be null. |
| propertyName | The name of the property to refresh. Cannot be null or empty. |
Implements ReteCore.IReteNode.
◆ Retract()
| void ReteProgram.AlphaToBetaAdapter.Retract |
( |
object | fact | ) |
|
Retracts a fact from the adapter. This method will remove any tokens from the connected BetaMemory that contain the specified fact. Since the adapter wraps facts into tokens, it relies on the BetaMemory's Retract method to identify and remove any tokens that include the retracted fact. This ensures that when a fact is retracted, all relevant tokens in the BetaMemory are updated accordingly, allowing successor nodes to adjust their state based on the change in facts.
- Parameters
-
| fact | The fact object to retract. Cannot be null. |
Implements ReteCore.IReteNode.
The documentation for this class was generated from the following file:
- ReteProgram/RuleBuilder.cs