|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.micropsi.nodenet.scripting.Script
Script. Abstract ancestor of all scripts that can be executed by an implementation of ScriptingManagerIF. Scripts are meant to be run in a separate thread, so the run() method defines how long the script is alive. terminate() comes from outside, telling the run() method to stop. run() and terminate must be implemented correctly or you will mess up the ScriptingManagerIF implementation. This abstract baseclass allows the registration of AbstractNetScriptEventListeners that fire upon different net events like netstep changes, gate or slot value changes etc.
| Constructor Summary | |
Script()
|
|
| Method Summary | |
protected Logger |
getLogger()
Returns the logger. |
protected Situation |
getSituation()
Returns the agent's current situation |
protected void |
registerEventListener(org.micropsi.nodenet.scripting.AbstractNetScriptEventListener listener)
Registern an AbstractNetScriptEventListener. |
abstract void |
run()
Runs the script. |
abstract void |
terminate()
Called when the run() method should come to an end. |
protected void |
unregisterAllListeners()
Unregisters all registered listeners. |
protected void |
unregisterEventListener(org.micropsi.nodenet.scripting.AbstractNetScriptEventListener listener)
Unregisters the given listener. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Script()
| Method Detail |
protected Logger getLogger()
protected Situation getSituation()
protected void registerEventListener(org.micropsi.nodenet.scripting.AbstractNetScriptEventListener listener)
listener - a listenerprotected void unregisterEventListener(org.micropsi.nodenet.scripting.AbstractNetScriptEventListener listener)
listener - the listener to be unregistered.protected void unregisterAllListeners()
public abstract void run()
throws MicropsiException,
java.lang.InterruptedException
MicropsiException,InterruptedException
MicropsiException
java.lang.InterruptedExceptionpublic abstract void terminate()
|
(c) by Micropsi Project: http://www.cognitive-agents.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||