|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectsimuLCS.Entity
simuLCS.Agent
simuLCS.AgentClassifier
simuLCS.AgentClassifierLearning
Agent with a Behaviour and a Learning Classifier System plugged in.
| Field Summary | |
protected ClassifierSet |
behaviourLearning
|
protected ClassifierSet |
behaviourTemp
|
protected ClassifierSet |
behaviourToShow
This behaviour is just a copy of behaviourLearning |
protected javax.swing.JButton |
buttonUpdate
|
protected java.awt.geom.Point2D |
coordGhost
|
static int |
EXPECTED_BEHAVIOUR
|
static int |
EXPECTED_BEHAVIOUR_TO_SHOW
|
protected boolean |
isGhostPainted
|
protected boolean |
isLearning
|
private static double |
MAX_ERROR
|
protected int |
nbOfStepsLearning
|
protected int |
nbOfStepsLearningFromLastPlot
|
protected java.awt.geom.Point2D |
oldcoordGhost
|
static int |
REAL_BEHAVIOUR
|
protected double |
totalRewardFromLastPlot
|
protected double |
totalRewardUntilNow
|
private static int |
UPDATE_BEHAVIOUR_TO_SHOW
|
protected boolean |
updateBehaviourTemp
|
protected boolean |
updateBehaviourToShow
|
| Fields inherited from class simuLCS.AgentClassifier |
behaviour, DETECTION_DISTANCE, isDetectionLimited, lastMovVector, template |
| 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 | |
|
AgentClassifierLearning(java.util.Random gen,
Arena a,
java.lang.String name)
Creates an ACL with a default behaviour "Avoid danger". |
protected |
AgentClassifierLearning(java.util.Random gen,
Arena a,
java.lang.String name,
Template t,
ClassifierSet b)
Creates an ACL with a given Template and a given Behaviour |
| Method Summary | |
protected void |
clearGhost(java.awt.Graphics2D g,
java.awt.geom.Point2D c)
Clear the drawing of the ghost |
double |
getAverageRewardFromLastPlot()
Get the average reward from the last plot, and reset the counters to start again to record |
double |
getAverageRewardUntilNow()
|
ClassifierSet |
getBehaviour(int whichOne)
Returns the given behaviour (real one, expected one, or expected one ordered) |
java.awt.geom.Point2D |
getCoordGhost()
|
int |
getNbOfStepsLearning()
|
java.awt.geom.Point2D |
getOldcoordGhost()
|
protected double |
getReward(java.awt.geom.Point2D real,
java.awt.geom.Point2D expected)
Get the reward from the environnement. |
double |
getTotalRewardUntilNow()
|
boolean |
isGhostPainted()
|
boolean |
isLearning()
|
private boolean |
isUpdateBehaviourTemp()
|
void |
move(Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
Moves the agent. |
protected void |
moveAndLearn(java.awt.geom.Point2D nextCoord,
Vector2D nextMovVector,
Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
Moves the Ghost and updates the rules with the reward |
protected ZClassifierSet |
moveLearner(Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
From the actual position of the agent, the system will try to guess where it is going to be at the next time step, by calculating its response according to its expected behaviour (ie the current behaviour provided by the Learning System). |
void |
paint(java.awt.Graphics2D g)
Removes the drawing of the agent for the old coordinates and repaint the agent at its new coordinates. |
protected void |
paintGhost(java.awt.Graphics2D g)
Paint the ghost (ie the Agent at the expected position) |
void |
requestUpdateBehaviourToShow(boolean simuIsRunning,
javax.swing.JButton b)
Asks for the behaviour to be updated. |
void |
setGhostPainted(boolean b)
|
void |
setLearning(boolean b)
|
void |
setTotalRewardUntilNow(double d)
|
private void |
setUpdateBehaviourTemp(boolean b)
|
protected void |
updateBehaviourToShow()
Create a copy of the current population and order the classifiers so that they can be shown ranked. |
| Methods inherited from class simuLCS.AgentClassifier |
canDetect, drawVisibilityCircle, getBehaviour, getLastMovVector, getNewMovVectorAccordingTo, getTemplate, isDetectionLimited, setBehaviour, setDetectionLimited, setLastMovVector, setTemplate |
| Methods inherited from class simuLCS.Agent |
clear, clear, getArena, 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 |
public static final int REAL_BEHAVIOUR
public static final int EXPECTED_BEHAVIOUR
public static final int EXPECTED_BEHAVIOUR_TO_SHOW
protected ClassifierSet behaviourToShow
behaviourLearning, with
the classifiers ordered to present them to the user.
protected ClassifierSet behaviourTemp
protected boolean updateBehaviourTemp
protected boolean updateBehaviourToShow
protected javax.swing.JButton buttonUpdate
protected java.awt.geom.Point2D coordGhost
protected java.awt.geom.Point2D oldcoordGhost
protected boolean isLearning
protected boolean isGhostPainted
private static final double MAX_ERROR
private static final int UPDATE_BEHAVIOUR_TO_SHOW
protected int nbOfStepsLearning
protected double totalRewardUntilNow
protected double totalRewardFromLastPlot
protected int nbOfStepsLearningFromLastPlot
protected ClassifierSet behaviourLearning
| Constructor Detail |
protected AgentClassifierLearning(java.util.Random gen,
Arena a,
java.lang.String name,
Template t,
ClassifierSet b)
gen - a - name - t - b -
public AgentClassifierLearning(java.util.Random gen,
Arena a,
java.lang.String name)
gen - a - name - | Method Detail |
protected ZClassifierSet moveLearner(Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
arena - g -
behaviourLearning
protected void moveAndLearn(java.awt.geom.Point2D nextCoord,
Vector2D nextMovVector,
Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
nextCoord - the REAL next position (to compare with the expected one)nextMovVector - the REAL next Movement Vectorarena - others - nbEntities - g -
protected double getReward(java.awt.geom.Point2D real,
java.awt.geom.Point2D expected)
expected -
public void move(Arena arena,
Entity[] others,
int nbEntities,
java.awt.Graphics2D g)
isLearning == true.
move in class AgentClassifierisLearning
protected void clearGhost(java.awt.Graphics2D g,
java.awt.geom.Point2D c)
g - c - protected void paintGhost(java.awt.Graphics2D g)
g - protected void updateBehaviourToShow()
public void requestUpdateBehaviourToShow(boolean simuIsRunning,
javax.swing.JButton b)
simuIsRunning - b - public void paint(java.awt.Graphics2D g)
isGhostPainted==true.
(This avoids a blinking effect)
paint in class AgentClassifierAgent#paint(),
isGhostPaintedpublic java.awt.geom.Point2D getCoordGhost()
public boolean isGhostPainted()
public boolean isLearning()
public int getNbOfStepsLearning()
public java.awt.geom.Point2D getOldcoordGhost()
public void setGhostPainted(boolean b)
b - public void setLearning(boolean b)
public ClassifierSet getBehaviour(int whichOne)
getBehaviour in class AgentwhichOne -
private boolean isUpdateBehaviourTemp()
private void setUpdateBehaviourTemp(boolean b)
public double getTotalRewardUntilNow()
public double getAverageRewardUntilNow()
public void setTotalRewardUntilNow(double d)
public double getAverageRewardFromLastPlot()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||