jadex.micro.examples.hunterprey
Class MicroPreyAgent

java.lang.Object
  extended by jadex.micro.MicroAgent
      extended by jadex.micro.examples.hunterprey.MicroPreyAgent
All Implemented Interfaces:
IMicroAgent

public class MicroPreyAgent
extends MicroAgent

Simple agent participating in hunter prey.


Nested Class Summary
 
Nested classes/interfaces inherited from class jadex.micro.MicroAgent
MicroAgent.TimerWrapper
 
Field Summary
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.
 
Fields inherited from class jadex.micro.MicroAgent
interpreter, longtime, timers
 
Constructor Summary
MicroPreyAgent()
           
 
Method Summary
protected  void act()
          Choose and perform an action.
 void executeBody()
          Execute a step.
 ISpaceObject getNearestFood()
          Get the known food.
 void setNearestFood(ISpaceObject food)
          Set the known food.
 
Methods inherited from class jadex.micro.MicroAgent
addService, agentCreated, agentKilled, createComponentIdentifier, createComponentIdentifier, createComponentIdentifier, createReply, createResultListener, createServiceContainer, getAgentAdapter, getAgentName, getArgument, getArguments, getComponentIdentifier, getConfiguration, getExternalAccess, getLogger, getParent, getServiceProvider, getTime, init, isAtBreakpoint, killAgent, messageArrived, removeService, scheduleStep, sendMessage, setResultValue, waitFor, waitForTick
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Constructor Detail

MicroPreyAgent

public MicroPreyAgent()
Method Detail

executeBody

public void executeBody()
Execute a step.

Specified by:
executeBody in interface IMicroAgent
Overrides:
executeBody in class MicroAgent

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.



Copyright © 2010. All Rights Reserved.