gnutant
Class ResponseGnutant
java.lang.Object
|
+--gnutant.ResponseGnutant
- All Implemented Interfaces:
- Ant, java.io.Serializable
- public class ResponseGnutant
- extends java.lang.Object
- implements Ant, java.io.Serializable
- Version:
- $Revision$
- Author:
- Alberto Montresor
- See Also:
- Serialized Form
Constructor Summary |
ResponseGnutant()
Default constructor for externalization |
ResponseGnutant(RequestId rid,
Resource[] resources,
NestId requestor,
AntId responseId)
Initializes a new ResponseGnutant with the set of resources to
be returned, the identifier of the requestor nest and an ant
identifier to be used to obtain return information through nests. |
Method Summary |
java.lang.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 |
run(AntView view)
This method encapsulate the computation performed by the
ant. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResponseGnutant
public ResponseGnutant(RequestId rid,
Resource[] resources,
NestId requestor,
AntId responseId)
- Initializes a new ResponseGnutant with the set of resources to
be returned, the identifier of the requestor nest and an ant
identifier to be used to obtain return information through nests.
ResponseGnutant
public ResponseGnutant()
- Default constructor for externalization
getSpecies
public java.lang.String getSpecies()
- Description copied from interface:
Ant
- Returns the identifier of the "species" of this ant.
Different ant species may have access to different
pheromone information in nests.
- Specified by:
getSpecies
in interface Ant
init
public void init(AntView view)
- Description copied from interface:
Ant
- This method is called on ants at the initialization time.
The view delivered to ants is not fully functional; for
example, ants cannot move to other nests or create new
ants during the execution of
init()
.
FIXME Implement the control in LocalAntView.
- Specified by:
init
in interface Ant
run
public void run(AntView view)
- This method encapsulate the computation performed by the
ant.
- Specified by:
run
in interface Ant
- Parameters:
view
- reference to the AntView object which
constitutes the controlled environment of the ant