1. (4 points) One model of mobile agents defines the following methods:
class MyAgent
{ private state-variables;
public void run()
{ //do some computation at the current
site
//decide on next location
to visit
dispatch(nextLocation);
}
}
In this model is that the dispatch method does not return. That is, you cannot structure the run method in the following way:
public void run()
{ //do first part of the computation
at the current site
//decide on next
location to visit
dispatch(nextLocation);
//do second part
of the computation at the next site
}
because the second part of the computation would never be executed.
The question: why are the dispatch and run methods defined as they are in this model. Hint: consider what would have to be done to allow the dispatch method to return at its new location.
2. (6 points) In one mobile agent system, agents are guaranteed
to receive messages sent to them regardless of the agent's movements. For
example, suppose that agent A is initially located at site X
but moves from site X to site Y and then to size Z while
a message M is being sent to agent A at site X. The
system guarantees that M will be received by A. Propose and
evaluate two different ways in which the message handling can be implemented
to guarantee the delivery of messages. Evaluate each proposal in terms
of overhead, reliability, and message delay.