All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ajanta.agent.ItinAgent

java.lang.Object
   |
   +----ajanta.agent.Agent
           |
           +----ajanta.agent.ItinAgent

public class ItinAgent
extends Agent
ItinAgent class extends the Agent class and abstracts the agent's mobility into an Itinerary. An Itinerary encode the agent's migration path, hence allows agent programmer to create a travel plan for the agent. Travel plans are created out of certain basic migartion patterns.

See Also:
pattern

Variable Index

 o itin

Constructor Index

 o ItinAgent(Credentials)
Itinerary of the agent is set to null
 o ItinAgent(Credentials, Itinerary)

Method Index

 o arrive()
The arrive() method represents an entry protocol.
 o checkDepartStatus(int)
This method is called by depart method giving it status of next() call in depart.
 o depart()
The depart() method represents an exit protocol.
 o getItinerary()
Itinerary and Credentials of the agent is set to null
 o run()
It is a empty method which can be overridden in subclasses.
 o setItinerary(Itinerary)
It sets the itinerary of the agent to the Itinerary object passed as argument
 o start(AgentEnv)
After agent has been successfuly created start method is called to launch the agent to first server in the itinerary.

Variables

 o itin
 protected Itinerary itin

Constructors

 o ItinAgent
 public ItinAgent(Credentials cred,
                  Itinerary itin)
Parameters:
cred - Credentials object of the agent
itin - Itinerary ( travel plan )object for the agent
 o ItinAgent
 public ItinAgent(Credentials cred)
Itinerary of the agent is set to null

Parameters:
cred - Credentials object of the agent

Methods

 o getItinerary
 public Itinerary getItinerary()
Itinerary and Credentials of the agent is set to null

 o start
 public void start(AgentEnv host) throws LaunchFailedException, UnknownHostException, Exception
After agent has been successfuly created start method is called to launch the agent to first server in the itinerary.

Parameters:
host - current agent server's AgentEnv ( agent environment )object
 o arrive
 public void arrive()
The arrive() method represents an entry protocol. It is automatically executed every time an agent arrives at a server. It is an empty method, and can be overridden in subclasses to define the application-specific entry protocol.

Overrides:
arrive in class Agent
 o depart
 public final void depart()
The depart() method represents an exit protocol. It is automatically executed every time an agent leaves a server. If itinerary is not yet completed then it launches the agent to the next server in the itinerary by calling next() on Itinerary object. This is a final method and can not be overridden in derived classes.

Overrides:
depart in class Agent
 o checkDepartStatus
 public void checkDepartStatus(int status)
This method is called by depart method giving it status of next() call in depart. Here application specific action can be taken based on the results of depart call.

 o run
 public void run()
It is a empty method which can be overridden in subclasses. This is the default method which get executed on a server if no other method is specified.

Overrides:
run in class Agent
 o setItinerary
 public void setItinerary(Itinerary itin)
It sets the itinerary of the agent to the Itinerary object passed as argument


All Packages  Class Hierarchy  This Package  Previous  Next  Index