<< Prev | - Up - | Next >> |
Our mobile agent platform uses the global store abstraction to offer a simple API for agent mobility. The agent platform provides fault tolerance, agent mobility without site dependencies, and permits home communication without any dependencies in a general and uniform way. An agent can create any number of global store. One global store for its own state, with which it can migrate. We use one global store shared between agents, for communication: that global store can be used to implement Send & Receive operation in a few lines of code. Our agents have the following properties:
An agent can move from one site to another, e.g., to reduce network latency.
The agent internal state is maintained when moving.
Agents live in Mozart's shared computation space and can therefore communicate.
An agent can continue to perform its task despite network inactivity (disconnected operation).
Agents are not affected by host failures.
Agents do not reference the file system when they move (except when initialising a global store). When an agent moves from one site to another, there is no need to load agent classes from a file system, e.g., like in IBM Aglets. The agent classes are transferred in a transparent way through interprocess communication.
The interface functions to use the mobile agents module are the following:
New
MA={New Agent.agent init(NewObj AgentStore)}
Creates a new agent with its own store. Agent.agent
is the agent class and NewObj
is the returned procedure to create new objects in the agent store. The second returned parameter AgentStore
is a reference to the agent store.
run
{MA run(F)}
An agent is a set of subtasks where a subtask is a computation that uses the resources at a single site. A substak is modeled by the functor F
. The call run(F)
executes F
in the agent home site i.e.the site where the call MA={New Agent.agent init(NewObj AgentStore)
is executed. F
must export the two following fields: AgentStore
and NewObj
. A agent(ill_formed_functor)
exception is raised if the AgentStore
and NewObj
are undefined.
move
{MA run(IPhostaddress F)}
Move the agent MA
to host IPhostaddress
and execute the functore F
remotely. F
has the same form restriction as the functor F
parameter of the run
call.
movehome
{MA movehome()}
Move the agent MA
to its home site
send
{MA send(Message)}
The executed send
call sends asynchronously a message to MA
.
receive
{MA receive(Message)}
The executed receive
call receives a message Message
at MA
from other agents.
<< Prev | - Up - | Next >> |