|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IExternalAgent
The IExternalAgent is an interface for external agents implemented in Java loaded into the virtual machine to participate in a simulation or real-time agent environment. The external agent can perform any Java actions. It generally does not make much sense to implement this interface to build a Java agent implementation as this interface does not provide access to the world state or other agents. To build external agents it is recommended to extend the abstract class AbstractExternalAgent.
Method Summary | |
---|---|
void |
doWork()
The virtual machine takes care of having the agent run in its own thread of execution. |
void |
initialize()
Initialize is used to initialize the external agent after it has been loaded into the virtual machine. |
void |
onAssert(IFact fact)
onAssert is called by the virtual machine whenever a new fact is asserted in the world state. |
void |
onProcess(long time)
onProcess is called by the virtual machine when the virtual machine is in simulation mode and the agent is notified by the scheduler that it is allowed to process any events for the specified time. |
void |
onReceive(IBelief belief)
onReceive is called by the virtual machine whenever a new belief is communicated to the external agent by another agent or object. |
void |
onRetract(IFact fact)
onRetract is called by the virtual machine whenever a fact is retracted from the world state. |
void |
pause()
Pauses the external agent. |
void |
reset()
Resets the external agent to the initialized state as it was placed in using the initialize method, performing any additional clean-up if necessary. |
void |
resume()
Resumes the external agent from a pause. |
void |
start()
Starts the external agent. |
void |
stop()
Stops the external agent. |
Method Detail |
---|
void initialize() throws ExternalException
ExternalException
- if an internal error occurs.void start() throws ExternalException
ExternalException
- if an internal error occurs.void pause() throws ExternalException
ExternalException
- if an internal error occurs.void resume() throws ExternalException
ExternalException
- if an internal error occurs.void stop() throws ExternalException
ExternalException
- if an internal error occurs.void reset() throws ExternalException
ExternalException
- if an internal error occurs.void doWork() throws ExternalException
ExternalException
- if an unrecoverable error occurs.void onProcess(long time) throws ExternalException
time
- the time for which agents can process their events.
ExternalException
- if an internal error occurs.void onReceive(IBelief belief) throws ExternalException
belief
- the IBelief communicated to this external agent
ExternalException
- if an error occurs handling this beliefvoid onAssert(IFact fact) throws ExternalException
fact
- the IFact asserted in the world state
ExternalException
- if an error occurs handling this factvoid onRetract(IFact fact) throws ExternalException
fact
- the IFact retracted from the world state
ExternalException
- if an error occurs handling this fact
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |