elge.world
Interface MoveableMatrix

All Known Implementing Classes:
MatrixRepresentation

public interface MoveableMatrix

Author:
Palino

Method Summary
 Point checkPosition(Point p)
          Checks if the position is acceptable.
 boolean move(MoveableAgent a, Point p)
          Tries to move the agent to a new position. if the position is not acceptable, false is returned and position is not changed.
 Point setPosition(MoveableAgent a, Point p)
          Sets the position for the agent.
 

Method Detail

setPosition

public Point setPosition(MoveableAgent a,
                         Point p)
Sets the position for the agent. If the position is not acceptable, a acceptable position is set and returned, if the position is ok, the p is returned.


checkPosition

public Point checkPosition(Point p)
Checks if the position is acceptable. If not, new position is returnd else the p is returned.


move

public boolean move(MoveableAgent a,
                    Point p)
Tries to move the agent to a new position. if the position is not acceptable, false is returned and position is not changed.