Class: Ruleby::Core::BaseBridgeNode
- Inherits:
-
ParentNode
- Object
- Printable
- Node
- ParentNode
- Ruleby::Core::BaseBridgeNode
- Defined in:
- lib/core/nodes.rb
Overview
The BridgeNode is used to bridge the alpha network to either the beta network, or to the terminal nodes. It creates a partial match from the pattern and atoms above it in the network. Thus, there is one bridge node for each pattern (assuming they aren’t shared).
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from ParentNode
Attributes inherited from Printable
Instance Method Summary collapse
- #assert(assertable) ⇒ Object
-
#initialize(bucket, pattern) ⇒ BaseBridgeNode
constructor
A new instance of BaseBridgeNode.
- #retract(assertable) ⇒ Object
Methods inherited from ParentNode
#add_out_node, #modify, #propagate, #propagate_assert, #propagate_modify, #propagate_retract
Methods inherited from Node
Methods inherited from Printable
Constructor Details
#initialize(bucket, pattern) ⇒ BaseBridgeNode
Returns a new instance of BaseBridgeNode.
574 575 576 577 |
# File 'lib/core/nodes.rb', line 574 def initialize(bucket, pattern) super(bucket) @pattern = pattern end |
Instance Method Details
#assert(assertable) ⇒ Object
579 580 581 |
# File 'lib/core/nodes.rb', line 579 def assert(assertable) propagate_assert(assertable.fact) end |
#retract(assertable) ⇒ Object
583 584 585 |
# File 'lib/core/nodes.rb', line 583 def retract(assertable) propagate_retract(assertable.fact) end |