Class: Ruleby::Core::BaseBridgeNode

Inherits:
ParentNode show all
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

BridgeNode, CollectNode

Instance Attribute Summary

Attributes inherited from ParentNode

#child_nodes

Attributes inherited from Printable

#parent_nodes

Instance Method Summary collapse

Methods inherited from ParentNode

#add_out_node, #modify, #propagate, #propagate_assert, #propagate_modify, #propagate_retract

Methods inherited from Node

#resolve

Methods inherited from Printable

#print

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