class Wongi::Engine::AlphaMemory

Attributes

betas[R]
rete[R]
template[R]

Public Class Methods

new(template, rete) click to toggle source
# File lib/wongi-engine/alpha_memory.rb, line 5
def initialize(template, rete)
  @template = template
  @rete = rete
  @betas = []
  @frozen = false
end

Public Instance Methods

activate(wme) click to toggle source
# File lib/wongi-engine/alpha_memory.rb, line 12
def activate(wme)
  # TODO: it used to activate before adding to the list. mandated by the original thesis. investigate. it appears to create duplicate tokens - needs a remedy in collecting nodes
  betas.each do |beta|
    beta.alpha_activate wme
  end
end
deactivate(wme) click to toggle source
# File lib/wongi-engine/alpha_memory.rb, line 19
def deactivate(wme)
  # p deactivate: {wme:}
  betas.each do |beta|
    beta.alpha_deactivate wme
  end
end
inspect() click to toggle source
# File lib/wongi-engine/alpha_memory.rb, line 26
def inspect
  "<Alpha #{__id__} template=#{template}>"
end
to_s() click to toggle source
# File lib/wongi-engine/alpha_memory.rb, line 30
def to_s
  inspect
end