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