|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object appletbots.WorldObject appletbots.Agent appletbots.balls.Kicker
public class Kicker
A kicker agent chooses a visible ball at random and accelerates towards it. If no ball is visible the agent sets his acceleration to zero.
Field Summary |
---|
Fields inherited from class appletbots.Agent |
---|
accelerationVectorColor, maxAcceleration, sight, velocityVectorColor, world |
Fields inherited from class appletbots.WorldObject |
---|
color, mass, maxSpeed, size |
Constructor Summary | |
---|---|
Kicker(int size,
int sight,
double maxSpeed,
double maxAcceleration)
Constructs a new Kicker with the given parameters |
Method Summary | |
---|---|
protected Ball |
chooseBall()
Selects a ball at random from those visible |
void |
observeWorld()
Observes the world, and follows the Kicker Algorithm. |
Methods inherited from class appletbots.Agent |
---|
getAcceleration, getMaxAcceleration, getRandomAcceleration, getShowAcceleration, getShowVelocity, getSight, getVectorsToDraw, setAcceleration, setShowAcceleration, setShowVelocity, setWorld |
Methods inherited from class appletbots.WorldObject |
---|
collidedWith, getColor, getMass, getMaxSpeed, getSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Kicker(int size, int sight, double maxSpeed, double maxAcceleration)
size
- The agent's radiussight
- The distance the agent can seemaxSpeed
- The maximum speed the agent can travelmaxAcceleration
- The maximum acceleration for this agentMethod Detail |
---|
public void observeWorld()
observeWorld
in class Agent
protected Ball chooseBall()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |