Class: Lernen::Algorithm::Procedural::ProceduralSUL
- Inherits:
-
System::MooreLikeSUL
- Object
- System::SUL
- System::MooreLikeSUL
- Lernen::Algorithm::Procedural::ProceduralSUL
- Defined in:
- lib/lernen/algorithm/procedural/procedural_sul.rb
Overview
ProceduralSUL is a wrapper of SUL for procedural learning.
Instance Method Summary collapse
-
#initialize(proc, sul, manager) ⇒ ProceduralSUL
constructor
: ( Call proc, System::SUL[In | Call | Return, bool] sul, ATRManager[In, Call, Return] manager ) -> void.
- #query(word) ⇒ Object
- #query_empty ⇒ Object
- #step(_input) ⇒ Object
Methods inherited from System::SUL
#query_last, #setup, #shutdown, #stats
Constructor Details
#initialize(proc, sul, manager) ⇒ ProceduralSUL
: (
Call proc,
System::SUL[In | Call | Return, bool] sul,
ATRManager[In, Call, Return] manager
) -> void
22 23 24 25 26 27 28 |
# File 'lib/lernen/algorithm/procedural/procedural_sul.rb', line 22 def initialize(proc, sul, manager) super(cache: false) @proc = proc @sul = sul @manager = manager end |
Instance Method Details
#query(word) ⇒ Object
36 37 38 |
# File 'lib/lernen/algorithm/procedural/procedural_sul.rb', line 36 def query(word) @sul.query(@manager.(@proc, word)) end |
#query_empty ⇒ Object
31 32 33 |
# File 'lib/lernen/algorithm/procedural/procedural_sul.rb', line 31 def query_empty @sul.query_last(@manager.(@proc, [])) end |
#step(_input) ⇒ Object
41 42 43 |
# File 'lib/lernen/algorithm/procedural/procedural_sul.rb', line 41 def step(_input) raise TypeError, "ProceduralSUL does not support `step`" end |