org.jscience.computing.ai.cellularautomaton
Class DirectedCAAgent

java.lang.Object
  extended by org.jscience.computing.ai.cellularautomaton.CAAgent
      extended by org.jscience.computing.ai.cellularautomaton.DirectedCAAgent

public class DirectedCAAgent
extends CAAgent

An extension of CAAgent that adds a directional functionality. A directed agent can move left or right, allowing for agents with more realistic movement.


Field Summary
static int BOTTOM
          DOCUMENT ME!
static int BOTTOM_LEFT
          DOCUMENT ME!
static int BOTTOM_RIGHT
          DOCUMENT ME!
protected  int direction
          DOCUMENT ME!
static int LEFT
          DOCUMENT ME!
static int RIGHT
          DOCUMENT ME!
static int TOP
          DOCUMENT ME!
static int TOP_LEFT
          DOCUMENT ME!
static int TOP_RIGHT
          DOCUMENT ME!
 
Fields inherited from class org.jscience.computing.ai.cellularautomaton.CAAgent
dataInteger, pos_x, pos_y, state
 
Constructor Summary
DirectedCAAgent()
          Creates a new instance of DirectedCAAgent
DirectedCAAgent(int x, int y, int state)
          Creates a new DirectedCAAgent object.
DirectedCAAgent(int x, int y, int state, int direction)
          Creates a new DirectedCAAgent object.
 
Method Summary
 int getDirection()
          DOCUMENT ME!
static int getDirection(int dx, int dy)
          DOCUMENT ME!
 int getDX()
          DOCUMENT ME!
 int getDY()
          DOCUMENT ME!
 void move(CellularAutomataLayered world)
          DOCUMENT ME!
 void moveLeft()
          DOCUMENT ME!
 void moveRight()
          DOCUMENT ME!
 void reverse()
          DOCUMENT ME!
 void setDirection(int dir)
          DOCUMENT ME!
 void setDX(int dx)
          DOCUMENT ME!
 void setDY(int dy)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.computing.ai.cellularautomaton.CAAgent
getState, getX, getY, setPosition, setState, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP

public static final int TOP
DOCUMENT ME!

See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT
DOCUMENT ME!

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
DOCUMENT ME!

See Also:
Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT
DOCUMENT ME!

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
DOCUMENT ME!

See Also:
Constant Field Values

BOTTOM_LEFT

public static final int BOTTOM_LEFT
DOCUMENT ME!

See Also:
Constant Field Values

LEFT

public static final int LEFT
DOCUMENT ME!

See Also:
Constant Field Values

TOP_LEFT

public static final int TOP_LEFT
DOCUMENT ME!

See Also:
Constant Field Values

direction

protected int direction
DOCUMENT ME!

Constructor Detail

DirectedCAAgent

public DirectedCAAgent()
Creates a new instance of DirectedCAAgent


DirectedCAAgent

public DirectedCAAgent(int x,
                       int y,
                       int state)
Creates a new DirectedCAAgent object.

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
state - DOCUMENT ME!

DirectedCAAgent

public DirectedCAAgent(int x,
                       int y,
                       int state,
                       int direction)
Creates a new DirectedCAAgent object.

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
state - DOCUMENT ME!
direction - DOCUMENT ME!
Method Detail

reverse

public void reverse()
DOCUMENT ME!


moveLeft

public void moveLeft()
DOCUMENT ME!


moveRight

public void moveRight()
DOCUMENT ME!


move

public void move(CellularAutomataLayered world)
DOCUMENT ME!

Parameters:
world - DOCUMENT ME!

getDX

public int getDX()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDX

public void setDX(int dx)
DOCUMENT ME!

Parameters:
dx - DOCUMENT ME!

getDY

public int getDY()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDY

public void setDY(int dy)
DOCUMENT ME!

Parameters:
dy - DOCUMENT ME!

getDirection

public int getDirection()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDirection

public void setDirection(int dir)
DOCUMENT ME!

Parameters:
dir - DOCUMENT ME!

getDirection

public static int getDirection(int dx,
                               int dy)
DOCUMENT ME!

Parameters:
dx - DOCUMENT ME!
dy - DOCUMENT ME!
Returns:
DOCUMENT ME!