appletbots.directedballs
Class DirectedKicker
java.lang.Object
appletbots.WorldObject
appletbots.Agent
appletbots.balls.Kicker
appletbots.directedballs.DirectedKicker
public class DirectedKicker
- extends Kicker
A directed kicker agent chooses a visible ball at random and tries to "kick"
it so that the ball will move in the the bot's goal direction. The agent
calculates the spot on the ball it needs to hit to knock the ball in the
right direction. If it senses that moving directly towards the target spot
will result in kicking the ball in another direction, the agent accelerates
around the bot (orthagonal to the vector towards the target spot) until it
can hit the target spot.
- Author:
- Erik Rasmussen
Constructor Summary |
DirectedKicker(Vector direction,
java.awt.Color color,
int size,
int sight,
double maxSpeed,
double maxAcceleration)
Constructs a new DirectedKicker with the given parameters |
Method Summary |
void |
observeWorld()
Observes the world, and follows the Directed Kicker Algorithm. |
Methods inherited from class appletbots.Agent |
getAcceleration, getMaxAcceleration, getRandomAcceleration, getShowAcceleration, getShowVelocity, getSight, getVectorsToDraw, setAcceleration, setShowAcceleration, setShowVelocity, setWorld |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
direction
protected Vector direction
- The goal direction
DirectedKicker
public DirectedKicker(Vector direction,
java.awt.Color color,
int size,
int sight,
double maxSpeed,
double maxAcceleration)
- Constructs a new DirectedKicker with the given parameters
- Parameters:
direction
- The agent's goal directioncolor
- The agent's colorsize
- The agent's radiussight
- The distance the agent can seemaxSpeed
- The maximum speed the agent can travelmaxAcceleration
- The maximum acceleration for this agent
observeWorld
public void observeWorld()
- Observes the world, and follows the Directed Kicker Algorithm.
- Overrides:
observeWorld
in class Kicker