|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmadkit.kernel.AbstractAgent
SEdit.Formalisms.World.Preys.Prey
public class Prey
The prey brain
| Field Summary | |
|---|---|
PreyBody |
body
|
| Constructor Summary | |
|---|---|
Prey()
|
|
| Method Summary | |
|---|---|
void |
activate()
This method is initially called when the micro-kernel registers the agent. |
void |
delete()
|
void |
doIt()
l'activateur des entites |
void |
end()
This method is called by the agent micro-kernel at the end of the agent lifecycle. |
WorldEntity |
getBody()
|
int |
getNbPredators()
|
void |
setBehaviorFileName(java.lang.String s)
|
void |
setBody(WorldEntity e)
|
void |
setNbPredators(int n)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public PreyBody body
| Constructor Detail |
|---|
public Prey()
| Method Detail |
|---|
public int getNbPredators()
public void setNbPredators(int n)
public void setBody(WorldEntity e)
setBody in interface Brainpublic WorldEntity getBody()
getBody in interface Brainpublic void delete()
delete in interface Brainpublic void setBehaviorFileName(java.lang.String s)
setBehaviorFileName in interface Brainpublic void activate()
AbstractAgent
Here is a typical example (taken from the PingPong agent of MadKit (plugin demos)) :
public void activate()
{
try {
createGroup(true,"ping-pong",null,null);
println ("No ping-pong group : I created one");
creator=true;
} catch (OrganizationRequestException e) { // the group already exists
creator=false;
println ("A ping-pong group already exists : I will join");
}
requestRole("ping-pong","player",null);
}
activate in class AbstractAgentpublic void end()
AbstractAgent
end in class AbstractAgentpublic void doIt()
doIt in interface Brain
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||