fipaos.tutorial
Class SearchAgent

fipaos.agent.FIPAOSAgent
  |
  +--fipaos.tutorial.SearchAgent

public class SearchAgent
extends FIPAOSAgent

The Search Agent is a tutorial agent showing how to construct an agent that simply registers with the local agent platform, and queries the DF for a list of registered Agents.

Please read both the Javadoc comments and the code comments to follow the tutorial.


Inner classes inherited from class fipaos.agent.FIPAOSAgent
FIPAOSAgent.TopLevelHandlerTask

Fields inherited from class fipaos.agent.FIPAOSAgent
_registered_with, _state

Constructor Summary
SearchAgent(String platform_profile, String name, String owner)
          An agent constructor takes three parameters - the location of the platform profile file (usually fipa-os\profiles\platform.profile), the agent name (e.g.

Method Summary
 voiddoneSearchAgent_SearchTask(Object obj)
          This method is invoked when the SearchTask completes (i.e.
 voiddoneSearchAgent_SearchTask(Task t)
          This method is invoked when the SearchTask completes (i.e.
 static voidmain(String[] args)
          A main method to enable the agent to be run from the command line.
 synchronized voidshutdown()
          Shuts down the agent by first deregistering with the DF and AMS (if registered) and then invoking shutdown() on the FIPAOSAgent shell

Methods inherited from class fipaos.agent.FIPAOSAgent
activate, forward, forward, getAID, getCurrentConversation, getHAP, getLocalAMS, getLocalAMSAID, getLocalDF, getLocalDFAID, getNewConversation, getOwnership, getPlatformProfile, getProfile, getState, isShutdown, notify, notify, notifyDone, notifyError, notifyMessageInEndedConversation, notifyMessageUndeliverable, notifyTimeout, sendNotUnderstood, sendNotUnderstood, setMessageSender, waitForPushLock

Constructor Detail

SearchAgent

public SearchAgent(String platform_profile, String name, String owner)
An agent constructor takes three parameters - the location of the platform profile file (usually fipa-os\profiles\platform.profile), the agent name (e.g. df, ams), and the owner of the agent (e.g. Nortel, Bob).
Parameters:
platform_profile - The location of the platform profile
name - The agent name
owner - The owner of this agent
Method Detail

doneSearchAgent_SearchTask

public void doneSearchAgent_SearchTask(Object obj)
This method is invoked when the SearchTask completes (i.e. it invokes its done( Object ) method) - as of FIPA-OS v1.4.0 top-level tasks (those created by the Agent implementation rather than a Task) interact with the Agent implementation they are part in a similar manner to a parent-Task

doneSearchAgent_SearchTask

public void doneSearchAgent_SearchTask(Task t)
This method is invoked when the SearchTask completes (i.e. it invokes its done() method) - as of FIPA-OS v1.4.0 top-level tasks (those created by the Agent implementation rather than a Task) interact with the Agent implementation they are part in a similar manner to a parent-Task

main

public static void main(String[] args)
A main method to enable the agent to be run from the command line. The agent takes two command line parameters - the platform profile location, which is set up by the SetupFIPAOS.bat file to be in the system variable %PLATFORM%, and the agent name.

shutdown

public synchronized void shutdown()
Shuts down the agent by first deregistering with the DF and AMS (if registered) and then invoking shutdown() on the FIPAOSAgent shell

Association Links

to Class java.lang.String