|
TuringSim
C++ framework to simulate abstract computing models
|
A class to run a simulate the execution of a Machine. More...
#include <runner/machineRunner.h>


Public Types | |
| typedef MachineType_ | MachineType |
| The type of the simulated machine. | |
| typedef ListenerType_ | ListenerType |
| The type of the listener. | |
| typedef MachineType::StateType | StateType |
| The type of states of the machine. | |
| typedef MachineType::StorageType | StorageType |
| The type of the memory of the machine. | |
| typedef MachineType::TransitionType | TransitionType |
| The type of transitions of the machine. | |
| typedef MachineType::ApplyHelperType | ApplyHelperType |
| The type of transitions apply helpers of the machine. | |
| typedef ListenerType::IdType | ListenerIdType |
| The type of identifiers used by the listener. | |
Public Member Functions | |
| MachineRunner (const MachineType &machine, ListenerType &listener) | |
| Construct a MachineRunner from a Machine. More... | |
| constexpr | MachineRunner (const MachineRunner &other)=default |
| Copy a runner. More... | |
| constexpr | MachineRunner (MachineRunner &&other)=default |
| Move a runner. More... | |
| constexpr MachineRunner & | operator= (const MachineRunner &other)=default |
| Copy a runner. More... | |
| constexpr MachineRunner & | operator= (MachineRunner &&other)=default |
| Move a runner. More... | |
| virtual | ~MachineRunner () override=default |
| Destroy the runner. | |
| virtual void | step (size_t nbIter=1)=0 |
| Execute a given number of steps of the machine, one step by default. More... | |
| virtual void | exec ()=0 |
| Run the machine until it halts. More... | |
Protected Member Functions | |
| virtual void | oneStep ()=0 |
| Execute one step of the machine. | |
Protected Attributes | |
| const MachineType & | machine |
| The simulated machine. | |
| ListenerType & | listener |
| The listener. | |
A class to run a simulate the execution of a Machine.
| MachineType_ | the type of the simulated machine. Must be a subclass of TuringSim::Machine::Machine. |
| ListenerType_ | the type of the listener that follows the execution of the listener. |
The listener is used to observe the execution of the machine.
This base class if pretty poor since we want to allow deterministic and non-deterministic executions, using arbitrary strategy.
Definition at line 132 of file machineRunner.h.
|
inline |
Construct a MachineRunner from a Machine.
| [in] | machine | the machine to run. |
| [in] | listener | the listener that monitors the machine execution. The machine is capture by const reference. |
Definition at line 181 of file machineRunner.h.
|
constexprdefault |
Copy a runner.
| [in] | other | the runner to copy. |
|
constexprdefault |
Move a runner.
| [in,out] | other | the runner to move. |
|
pure virtual |
Run the machine until it halts.
Beware, beware! It is intrinsically unsafe! And we provide NO warranty.
Implemented in TuringSim::Runner::NonDeterministicSimpleFiniteStateMachineRunner< MachineType_, ListenerType_, std::tuple< ListenerConstructorArgs... > >, TuringSim::Runner::NonDeterministicMachineRunner< MachineType_, ListenerType_, std::tuple< ListenerConstructorArgs... > >, TuringSim::Runner::MaybeEpsilonFiniteStateMachineRunner< MachineType_, ListenerType_, std::tuple< ListenerConstructorArgs... > >, and TuringSim::Runner::DeterministicMachineRunner< MachineType_, ListenerType_, std::tuple< Args... > >.
|
constexprdefault |
Copy a runner.
| [in] | other | the runner to copy. |
*this.
|
constexprdefault |
Move a runner.
| [in,out] | other | the runner to move. |
*this.
|
pure virtual |
Execute a given number of steps of the machine, one step by default.
| [in] | nbIter | the number of steps to run. |
Implemented in TuringSim::Runner::NonDeterministicSimpleFiniteStateMachineRunner< MachineType_, ListenerType_, std::tuple< ListenerConstructorArgs... > >, TuringSim::Runner::NonDeterministicMachineRunner< MachineType_, ListenerType_, std::tuple< ListenerConstructorArgs... > >, TuringSim::Runner::MaybeEpsilonFiniteStateMachineRunner< MachineType_, ListenerType_, std::tuple< ListenerConstructorArgs... > >, and TuringSim::Runner::DeterministicMachineRunner< MachineType_, ListenerType_, std::tuple< Args... > >.