Package jadex.micro.examples.hunterprey
Class MicroPreyAgent
- java.lang.Object
-
- jadex.micro.examples.hunterprey.MicroPreyAgent
-
public class MicroPreyAgent extends java.lang.ObjectSimple agent participating in hunter prey.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected Grid2DenvThe environment.protected ISpaceObjectfoodThe nearest food (if any).protected java.lang.StringlastdirThe last move direction (if any).protected IResultListenerlistenerThe result listener starting the next action.protected ISpaceObjectmyselfThe creature's self representation.
-
Constructor Summary
Constructors Constructor Description MicroPreyAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidact()Choose and perform an action.IFuture<java.lang.Void>executeBody()Execute a step.ISpaceObjectgetNearestFood()Get the known food.voidsetNearestFood(ISpaceObject food)Set the known food.
-
-
-
Field Detail
-
env
protected Grid2D env
The environment.
-
myself
protected ISpaceObject myself
The creature's self representation.
-
lastdir
protected java.lang.String lastdir
The last move direction (if any).
-
food
protected ISpaceObject food
The nearest food (if any).
-
listener
protected IResultListener listener
The result listener starting the next action.
-
agent
protected IInternalAccess agent
The agent.
-
-
Method Detail
-
executeBody
public IFuture<java.lang.Void> executeBody()
Execute a step.
-
act
protected void act()
Choose and perform an action.
-
getNearestFood
public ISpaceObject getNearestFood()
Get the known food.
-
setNearestFood
public void setNearestFood(ISpaceObject food)
Set the known food.
-
-