Class: Lernen::System::MooreLikeSimulator
Overview
MooreLikeSimulator is a system under learning (SUL) using a Moore-like machine simulation.
Instance Method Summary
collapse
Methods inherited from SUL
#query, #query_last, #stats
Constructor Details
#initialize(automaton, cache: true) ⇒ MooreLikeSimulator
: (Automaton::MooreLike[Conf, In, Out] automaton, ?cache: bool) -> void
16
17
18
19
20
21
|
# File 'lib/lernen/system/moore_like_simulator.rb', line 16
def initialize(automaton, cache: true)
super(cache:)
@automaton = automaton
@current_conf = nil
end
|
Instance Method Details
#query_empty ⇒ Object
40
41
42
|
# File 'lib/lernen/system/moore_like_simulator.rb', line 40
def query_empty
@automaton.run_empty
end
|
#setup ⇒ Object
24
25
26
|
# File 'lib/lernen/system/moore_like_simulator.rb', line 24
def setup
@current_conf = @automaton.initial_conf
end
|
#shutdown ⇒ Object
29
30
31
|
# File 'lib/lernen/system/moore_like_simulator.rb', line 29
def shutdown
@current_conf = nil
end
|
#step(input) ⇒ Object
34
35
36
37
|
# File 'lib/lernen/system/moore_like_simulator.rb', line 34
def step(input)
output, @current_conf = @automaton.step(@current_conf, input) output
end
|