|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--ants.random.RandomAnt
This class contains the implementation of a simple ant which performs a random walk through the network. Ants move forward until they reach the searched resource; then, they move backward along the incoming path. When they reach the requestor nest, they copy the resource locally.
| Constructor Summary | |
RandomAnt(RequestId rid,
String query)
Instantiate a new RandomAnt by setting the query to be satisfied and the hash value to be searched. |
|
| Method Summary | |
String |
getSpecies()
Returns the identifier of the "species" of this ant. |
void |
init(AntView view)
This method is called on ants at the initialization time. |
void |
readExternal(ObjectInput in)
|
void |
run(AntView view)
This method encapsulate the computation performed by the ant. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RandomAnt(RequestId rid,
String query)
| Method Detail |
public String getSpecies()
getSpecies in interface Antpublic void init(AntView view)
Antinit().
FIXME Implement the control in LocalAntView.
init in interface Antpublic void run(AntView view)
run in interface Antview - reference to the AntView object which
constitutes the controlled environment of the ant
public void writeExternal(ObjectOutput out)
throws IOException
IOExceptionpublic void readExternal(ObjectInput in)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||