Class: Wongi::Engine::FilterNode

Inherits:
BetaNode
  • Object
show all
Defined in:
lib/wongi-engine/beta/filter_node.rb

Instance Attribute Summary collapse

Attributes inherited from BetaNode

#children, #parent, #rete

Instance Method Summary collapse

Methods inherited from BetaNode

#beta_memory, #depth, #filter_node, #join_node, #ncc_node, #neg_node, #network, #optional_node, #update_above

Methods included from CoreExt

included

Constructor Details

#initialize(parent, test) ⇒ FilterNode

Returns a new instance of FilterNode.



93
94
95
96
# File 'lib/wongi-engine/beta/filter_node.rb', line 93

def initialize parent, test
  super parent
  self.test = test
end

Instance Attribute Details

#testObject

Returns the value of attribute test.



91
92
93
# File 'lib/wongi-engine/beta/filter_node.rb', line 91

def test
  @test
end

Instance Method Details

#equivalent?(test) ⇒ Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/wongi-engine/beta/filter_node.rb', line 104

def equivalent? test
  test == self.test
end

#left_activate(token) ⇒ Object



98
99
100
101
102
# File 'lib/wongi-engine/beta/filter_node.rb', line 98

def left_activate token
  if test.passes? token
    propagate_activation token, nil, {}
  end
end