Class Agent

java.lang.Object
  |
  +--Agent

public class Agent
extends java.lang.Object

Die Klasse Agent repräsentiert einen Agenten, also eine Ameise oder Biene, oder einen Elefant.
Ein solcher Agent weiss, wo er ist, wie seine Zufallszahlen entstehen, wie weit er sehen kann, was er sieht, er kann über einen Baum auf sein Genom zugreifen (cf. PatternGenerator) und er weiss, was er gerade macht und was er macht, wenn mehrere seiner Gene auf seine Nest passen.
Ausserdem ist ein solcher Agent immer bemüht am Nest zu bleiben. Stand: 09.07.2001


Field Summary
protected  Action currentAction
           
protected  Koord3D position
           
protected  Random rand
           
protected  Koord3D sichtweite
           
protected  int strategy
           
protected  Knoten tree
           
protected  Blickfeld view
           
 
Constructor Summary
Agent(Koord3D koords, Koord3D sichtweite, Blickfeld view, Knoten tree)
           
 
Method Summary
 boolean bOrNot2B()
           
protected  boolean contained(int direction, int[] list)
           
 int getDirectionByGen()
           
 int getGenUsed()
           
protected  int getIndexWithLeastJoker(Action[] temp)
           
protected  int getIndexWithMostJoker(Action[] temp)
           
protected  int[] getMovesList()
           
 Koord3D getPosition()
           
 int getStrategy()
           
protected  boolean hasAtLeastOneNeighboringStone(Koord3D virtualPos)
           
 void lookAround()
           
 Koord3D moveYou()
           
 void setPosition(Koord3D newPosition)
           
 void setStrategy(int strategy)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

position

protected Koord3D position

rand

protected Random rand

sichtweite

protected Koord3D sichtweite

view

protected Blickfeld view

tree

protected Knoten tree

currentAction

protected Action currentAction

strategy

protected int strategy
Constructor Detail

Agent

public Agent(Koord3D koords,
             Koord3D sichtweite,
             Blickfeld view,
             Knoten tree)
Method Detail

getGenUsed

public int getGenUsed()

lookAround

public void lookAround()

getDirectionByGen

public int getDirectionByGen()

moveYou

public Koord3D moveYou()
                throws NoMoveLeftException

setPosition

public void setPosition(Koord3D newPosition)

getPosition

public Koord3D getPosition()

contained

protected boolean contained(int direction,
                            int[] list)

getMovesList

protected int[] getMovesList()

hasAtLeastOneNeighboringStone

protected boolean hasAtLeastOneNeighboringStone(Koord3D virtualPos)

getIndexWithLeastJoker

protected int getIndexWithLeastJoker(Action[] temp)

getIndexWithMostJoker

protected int getIndexWithMostJoker(Action[] temp)

bOrNot2B

public boolean bOrNot2B()

setStrategy

public void setStrategy(int strategy)

getStrategy

public int getStrategy()