Class: Wongi::Engine::ProductionNode

Inherits:
BetaMemory show all
Defined in:
lib/wongi-engine/beta/production_node.rb

Instance Attribute Summary collapse

Attributes inherited from BetaMemory

#last_token, #tokens

Attributes inherited from BetaNode

#children, #parent, #rete

Instance Method Summary collapse

Methods inherited from BetaMemory

#seed, #subst

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, actions) ⇒ ProductionNode

Returns a new instance of ProductionNode.



8
9
10
11
12
# File 'lib/wongi-engine/beta/production_node.rb', line 8

def initialize parent, actions
  super(parent)
  @actions = actions
  @actions.each { |action| action.production = self }
end

Instance Attribute Details

#tracerObject

Returns the value of attribute tracer.



6
7
8
# File 'lib/wongi-engine/beta/production_node.rb', line 6

def tracer
  @tracer
end

Instance Method Details

#deexecute(token) ⇒ Object

> TODO: investigate



25
26
27
# File 'lib/wongi-engine/beta/production_node.rb', line 25

def deexecute token

end

#left_activate(token, wme, assignments) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/wongi-engine/beta/production_node.rb', line 14

def left_activate token, wme, assignments
  super
  @actions.each do |action|
    # @tokens.each do |t|
    #  action.execute t
    # end
    action.execute last_token if action.respond_to? :execute
  end
end