public class ExplorerThread
extends java.lang.Object
implements java.lang.Runnable
Runnable
interface, to able to run an exploration strategy in a separate thread. It
is also responsible to initialize the exploration, start the exploration (call the IStrategy.explore()
method), catch any exception during exploration and to shutdown the thread correctly.Constructor and Description |
---|
ExplorerThread(ThreadContext context) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of this strategy.
|
ThreadContext |
getThreadContext()
Returns the associated
ThreadContext that houses all the thread specific data about the exploration
process, and is also the gateway to the GlobalContext which stores data relevant to the design space
exploration process as a whole. |
void |
run()
Starts the design space exploration.
|
void |
stopRunning()
Signals the
IStrategy instance that execution should be stopped. |
public ExplorerThread(ThreadContext context)
public void stopRunning()
IStrategy
instance that execution should be stopped. By contract, the strategy is to
stop execution at the next stage of execution where stopping and exiting is appropriate.public void run()
IStrategy.explore()
method returns.run
in interface java.lang.Runnable
public void dispose()
RuleEngine
and
ViatraQueryEngine
. Calling this is only required if the design space exploration was launched in thread, as
the underlying engines get collected on the stop of the running Thread
.public ThreadContext getThreadContext()
ThreadContext
that houses all the thread specific data about the exploration
process, and is also the gateway to the GlobalContext
which stores data relevant to the design space
exploration process as a whole.ThreadContext
.