|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectsimuLCS.Entity
simuLCS.Agent
simuLCS.AgentClassifier
Agent having a behaviour described as a set of rules (classifiers).
| Field Summary | |
protected ClassifierSet |
behaviour
The behaviour of the Agent |
protected double |
DETECTION_DISTANCE
Size of the visibility circle |
protected boolean |
isDetectionLimited
Indicates whether or not a Visibility Circle should be used |
protected Vector2D |
lastMovVector
Last movement vector (for the computation of the inertia |
protected Template |
template
The template used by the Agent for its behaviour |
| Fields inherited from class simuLCS.Agent |
arena, heading, oldcoord |
| Fields inherited from class simuLCS.Entity |
color_ext, color_int, coord, generator, name, paintName, size |
| Constructor Summary | |
AgentClassifier(java.util.Random gen,
Arena a,
java.lang.String name)
Creates an AgentClassifier randmoly placed inside the Arena |
|
| Method Summary | |
boolean |
canDetect(Entity e)
Indicates if an Entity can be detected (inside the Visibility Circle). |
protected void |
drawVisibilityCircle(java.awt.Graphics2D g,
java.awt.geom.Point2D coord,
java.awt.Color c)
Draw the Circle around the Agent |
ClassifierSet |
getBehaviour()
For compatibility reasons, subclasses might implement an Agent whose behaviour is described by a ClassifierSet. |
Vector2D |
getLastMovVector()
|
Vector2D |
getNewMovVectorAccordingTo(ClassifierSet behaviourToConsider,
Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g,
ClassifierSet actionSetToReturn)
Calculates the New Movement Vector according to the behaviourToConsider.
|
Template |
getTemplate()
|
boolean |
isDetectionLimited()
|
void |
move(Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
Move the agent according to its behaviour and the others entities around. |
void |
paint(java.awt.Graphics2D g)
Paint the Agent Classifier + its circle if it has one. |
void |
setBehaviour(ClassifierSet behaviour)
|
void |
setDetectionLimited(boolean b)
|
void |
setLastMovVector(Vector2D lastMovVector)
|
void |
setTemplate(Template template)
|
| Methods inherited from class simuLCS.Agent |
clear, clear, getArena, getBehaviour, getCoordNearTo, getRadius, isDangerous, isMoving, move, toString |
| Methods inherited from class simuLCS.Entity |
collideWithMe, distanceTo, getColor_ext, getColor_int, getCoord, getId, getName, getRadiusBody, getSize, isPaintName, setColor_ext, setColor_int, setName, setPaintName, setSize |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Template template
protected boolean isDetectionLimited
protected double DETECTION_DISTANCE
protected Vector2D lastMovVector
protected ClassifierSet behaviour
| Constructor Detail |
public AgentClassifier(java.util.Random gen,
Arena a,
java.lang.String name)
gen - a - name - | Method Detail |
public Vector2D getNewMovVectorAccordingTo(ClassifierSet behaviourToConsider,
Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g,
ClassifierSet actionSetToReturn)
behaviourToConsider.
This corresponds to the procedure "Guess New Position"
behaviourToConsider - arena - others - nbEntities - g - actionSetToReturn -
public void move(Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
move in class AgentEntity.move(Arena, Entity[], int, Graphics2D)public boolean canDetect(Entity e)
e - the Entity to detect
protected void drawVisibilityCircle(java.awt.Graphics2D g,
java.awt.geom.Point2D coord,
java.awt.Color c)
g - coord - c - public void paint(java.awt.Graphics2D g)
paint in class AgentEntity#paint()public ClassifierSet getBehaviour()
Agent
getBehaviour in class Agentbehaviour,
ClassifierSetpublic Vector2D getLastMovVector()
public Template getTemplate()
public void setBehaviour(ClassifierSet behaviour)
public void setLastMovVector(Vector2D lastMovVector)
public void setTemplate(Template template)
public boolean isDetectionLimited()
public void setDetectionLimited(boolean b)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||