-
- Type Parameters:
I
- input symbolsO
- output symbols
- All Known Subinterfaces:
ObservableSUL<S,I,O>
,StateLocalInputSUL<I,O>
,StatisticSUL<I,O>
- All Known Implementing Classes:
AbstractContextExecutableInputSUL
,ContextExecutableInputSUL
,CounterObservableSUL
,CounterStateLocalInputSUL
,CounterSUL
,ExecutableInputSUL
,MappedSUL
,MealySimulatorSUL
,ObservableMealySimulatorSUL
,SimplePOJOTestDriver
,StateLocalInputMealySimulatorSUL
,StateLocalInputSULCache
,SULCache
,ThreadSafeStateLocalInputSULCache
,ThreadSafeSULCache
public interface SUL<I,O>
Interface for a system under learning (SUL) that can make single steps.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
canFork()
Returns whether this SUL is capable offorking
.default SUL<I,O>
fork()
Forks this SUL, if possible.void
post()
shut down SUL.void
pre()
setup SUL.O
step(I in)
make one step on the SUL.
-
-
-
Method Detail
-
pre
void pre()
setup SUL.
-
post
void post()
shut down SUL.
-
step
O step(I in)
make one step on the SUL.- Parameters:
in
- input to the SUL- Returns:
- output of SUL
- Throws:
SULException
- if the input symbol cannot be executed on the SUL
-
canFork
default boolean canFork()
Returns whether this SUL is capable offorking
.- Returns:
true
if this SUL can be forked,false
otherwise- See Also:
fork()
-
fork
default SUL<I,O> fork()
Forks this SUL, if possible. The fork of a SUL is a copy which behaves exactly the same as this SUL. This method should always return a reseted SUL, regardless of whether this call is made between a call topre()
andpost()
.If
canFork()
returnstrue
, this method must return a non-null
object, which should behave exactly like this SUL (in particular, it must be forkable as well). Otherwise, aUnsupportedOperationException
must be thrown.Implementation note: if resetting a SUL changes the internal state of this object in a non-trivial way (e.g., incrementing a counter to ensure independent sessions), care must be taken that forks of this SUL manipulate the same internal state.
- Returns:
- a fork of this SUL.
- Throws:
UnsupportedOperationException
- if this SUL can't be forked.
-
-