Class: Wongi::Engine::NccNode
- Defined in:
- lib/wongi-engine/beta/ncc_node.rb
Instance Attribute Summary collapse
-
#partner ⇒ Object
Returns the value of attribute partner.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Attributes inherited from BetaNode
Instance Method Summary collapse
-
#initialize(parent) ⇒ NccNode
constructor
A new instance of NccNode.
-
#left_activate(token, wme = nil, assignments = { }) ⇒ Object
def left_activate token, wme, assignments t = Token.new token, wme, assignments t.node = self.
Methods inherited from BetaNode
#beta_memory, #depth, #filter_node, #join_node, #ncc_node, #neg_node, #network, #optional_node, #update_above
Methods included from CoreExt
Constructor Details
#initialize(parent) ⇒ NccNode
Returns a new instance of NccNode.
23 24 25 26 |
# File 'lib/wongi-engine/beta/ncc_node.rb', line 23 def initialize parent super @tokens = [] end |
Instance Attribute Details
#partner ⇒ Object
Returns the value of attribute partner.
21 22 23 |
# File 'lib/wongi-engine/beta/ncc_node.rb', line 21 def partner @partner end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
20 21 22 |
# File 'lib/wongi-engine/beta/ncc_node.rb', line 20 def tokens @tokens end |
Instance Method Details
#left_activate(token, wme = nil, assignments = { }) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/wongi-engine/beta/ncc_node.rb', line 31 def left_activate token, wme = nil, assignments = { } # => FIXME: left_activate has different signatures for storing and non-storing nodes... t = Token.new token, nil, {} tokens << t partner.tokens.each do |ncc_token| t.ncc_results << ncc_token ncc_token.owner = t end if t.ncc_results.empty? children.each do |child| child.left_activate t, nil, {} end end end |