Hi!
> When the agent arrives to the other agency GrassHopper recreats
> the agent, however, I can not restart the jess engine thread thus the Rete
> engine without resetting it.
Why is that?
> Could you please help me out how to restart the engine thread without
> reseting the Rete network, thus loosing the facts.
You are not forced to reset the engine. Look at the sample code below:
...
// Create engine for the very first time and reset it
Rete engine = new Rete();
engine.reset(); // One-time reset
...
// Run engine
EngineRunner runner = new EngineRunner(engine);
runner.start();
...
// Halt engine. This will make runUntilHalt() return.
engine.halt();
/**
* EngineRunner thread
*/
public class EngineRunner extends Thread {
private Rete m_engine;
public EngineRunner(Rete engine) {
m_engine = engine;
}
public void run() {
try {
m_engine.runUntilHalt();
} catch (JessException ex) {
...
}
}
}
You can stop the engine and recreate/start the EngineRunner thread as often as needed
without resetting the engine.
Thomas
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------