|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--antsim.nestor.LocalAntView
Class LocalAntView is a simple implementation of interface
AntView, which implements methods included in
it by invoking the opportune methods on the local nest.
| Method Summary | |
void |
addAnt(Ant ant)
FIXME: comment. |
void |
addNeighbour(NestId id)
Add the new neighbor information to the Gate object contained
in the current nest. |
AntId |
createAntId()
Creates a new ant identifier. |
ResourceManager |
createResourceManager(String name)
Returns a reference to the resource manager identified by the given name, if present. |
Ant |
getAnt()
Returns the ant which is associated to this AntView. |
NestId |
getLastVisited()
Returns the identifier of the last nest visisted by this ant. |
Neighbour[] |
getNeighbours()
Ants invoke this method to obtain the list of nest neighbors known to the current nest. |
NestId |
getNestId()
Returns the identifier of the current nest hosting the ant using this AntView. |
ResourceManager |
getResourceManager(String name)
Returns a reference to the resource manager identified by the given name. |
int |
getTTL()
|
void |
move(NestId id)
Moves an ant to the specified nest. |
void |
removeNeighbour(NestId id)
FIXME: Implement. |
boolean |
returnResources(RequestId rid,
Resource[] resources)
This method is invoked by ants to notify the nest that the ant associated to this AntView, created to satisfy a request, is returning the specified set of resources. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public NestId getNestId()
AntViewAntView.
getNestId in interface AntViewpublic NestId getLastVisited()
AntView
getLastVisited in interface AntViewpublic int getTTL()
getTTL in interface AntViewpublic Ant getAnt()
AntViewAntView. Normally not
used by ants, as they may access the same information using
this.
getAnt in interface AntViewpublic AntId createAntId()
createAntId in interface AntViewpublic void addAnt(Ant ant)
The exact behavior of this method depends on the class implementing
the Manager interface currently used in the current nest.
Please refer to the implementation documentation for more details.
Please see the corresponding method comment in interface
AntView for additional information.
addAnt in interface AntViewant - the ant to be added to the current nest
public void move(NestId id)
throws IOException
The exact behavior of this method depends on the class implementing
the Gate interface currently used in the current nest.
Please refer to the implementation documentation for more details.
Please see the corresponding method comment in interface
AntView for additional information.
move in interface AntViewid - the id of the destination nest
IOException - if the ant cannot move to the
destination nest for communication problems.
public void addNeighbour(NestId id)
throws IOException
Gate object contained
in the current nest. FIXME: correct implementation by removing addAntNeighbour
and adding the method to Gate.
The exact behavior of this method depends on the class implementing
the Gate interface currently used in the current nest.
Please refer to the implementation documentation for more details.
Please see the corresponding method comment in interface
AntView for additional information.
addNeighbour in interface AntViewIOException - if a connection with the nest cannot be established.public void removeNeighbour(NestId id)
The exact behavior of this method depends on the class implementing
the Gate interface currently used in the current nest.
Please refer to the class documentation for more details.
Please see the corresponding method comment in interface
AntView for additional information.
removeNeighbour in interface AntViewpublic Neighbour[] getNeighbours()
The exact behavior of this method depends on the class implementing
the Gate interface currently used in the current nest.
Please refer to the implementation documentation for more details.
Please see the corresponding method comment in interface
AntView for additional information.
getNeighbours in interface AntViewpublic ResourceManager getResourceManager(String name)
getResourceManager in interface AntView
public ResourceManager createResourceManager(String name)
throws ResourceManagerException
createResourceManager in interface AntViewResourceManagerException
public boolean returnResources(RequestId rid,
Resource[] resources)
returnResources in interface AntViewresources - the resources satisfying the query
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||