Jadex 0.96

jadex.examples.hunterprey
Interface IEnvironment

All Known Implementing Classes:
Environment

public interface IEnvironment

Interface for the hunter-prey environment. Defines all operations that a hunter or prey may perform.


Method Summary
 boolean eat(Creature me, WorldObject food)
          Eat some object.
 Vision getVision(Creature me)
          Get the current vision.
 boolean moveDown(Creature me)
          Move one field downwards.
 boolean moveLeft(Creature me)
          Move one field to the left.
 boolean moveRight(Creature me)
          Move one field to the right.
 boolean moveUp(Creature me)
          Move one field upwards.
 

Method Detail

moveUp

boolean moveUp(Creature me)
Move one field upwards. The method will block until the current simulation step has finished.

Returns:
True, when the operation succeeded.

moveDown

boolean moveDown(Creature me)
Move one field downwards. The method will block until the current simulation step has finished.

Returns:
True, when the operation succeeded.

moveLeft

boolean moveLeft(Creature me)
Move one field to the left. The method will block until the current simulation step has finished.

Returns:
True, when the operation succeeded.

moveRight

boolean moveRight(Creature me)
Move one field to the right. The method will block until the current simulation step has finished.

Returns:
True, when the operation succeeded.

eat

boolean eat(Creature me,
            WorldObject food)
Eat some object. The object has to be at the same location. This method does not block, and can be called multiple times during each simulation step.

Parameters:
food - The object.
Returns:
True, when the operation succeeded.

getVision

Vision getVision(Creature me)
Get the current vision. This method does not block, and can be called multiple times during each simulation step.


Jadex 0.96

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.