This package contains the necessary classes for an interruptible framework.
The InterruptibleNodeModel
consists of three abstract methods:
init(DataTable[] input)
executeOneIteration()
DataTable[] getOutput()
When an InterruptibleNodeModel is executed, first the init m(DataTable[])
method is called. The model starts with paused = true
.
When this is set to paused = false
the
executeOneIteration
method is called until the model is set to the
paused state again. In this way the model could be run and paused arbitrary often.
When the model is set to finish()
the
getOutput()
method is called and the result is provided at the out-port
and the model is executed and must be reset for a new run.
Existing models can be easily be adapted to an interruptible model, since most
of all models contain a for-
or while-
loop.
Then the content of this loop has to be put into executeOneIteration
method.
A default implementation for the InterruptibleNodeView
is also provided, with
some default control elements always on top. These control elements are contained
in the InterruptControlPanel
. They are a play, break and finish and
a next step button and a slider to adjust the delay how often the
InterruptibleNodeView
is refreshed.