public abstract class Pilot
extends jrobots.simulation.simulationObjects.AbstractPilot
Pilot
steers a Panzer
. A inheriting class may add fields at will, but it has to be ensured that the object's state does not exeed a predefined size, as the framework serializes and stores it at every simulation step.
For every competition, a compulsory base class is chosen for you as
participant. Inheriting from a different base class will expulse you from
the competition. Please refer to the current OnsetBot
implementation to get the correct class.
Every time a Pilot is instantiated, the framework calls its
init()
routine. The method of central relevance, however, is
named actions()
. This routine is called at every simulation step
and it is able to use methods that steer the underlying Panzer. It has to be
taken special care of the execution time of actions()
, as it is
measured, and, if it exeeds a certain treshold (that is reasonably high for
most porposes), the framework exerts punishment among Panzer and Pilot.
Modifier and Type | Class and Description |
---|---|
protected static class |
Pilot.DropperCommand |
protected static class |
Pilot.LauncherAmmunition |
Modifier and Type | Field and Description |
---|---|
protected static Angle |
DOWN
The degree value of this
Angle is 90°. |
protected static Angle |
LEFT
The degree value of this
Angle is 180°. |
protected static Angle |
RIGHT
The degree value of this
Angle is 0°. |
protected static Angle |
UP
The degree value of this
Angle is 270°. |
Constructor and Description |
---|
Pilot() |
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBodyColor()
This color filter is applied to the body texture
|
abstract jrobots.simulation.simulationObjects.BodyFactory |
getBodyFactory()
determines the favorite supplier this
Pilot is designed for. |
protected TerrainType |
getCurrentTerrain()
The
JRobot has a center mounted terrain sensor. |
double |
getEnergy()
Energie wird benötigt für Fahren, Botscanner, Schießen
und für den Booster.
|
double |
getHealth()
Der Zustand eines
Panzer s reicht von 0.0 (nächster
Treffer verschrottet Panzer) bis 1.0 (voll intakt). |
protected boolean |
getIsMovingInWrongDirection()
In race mode: Velocity is pointing in the backward racetrack hemisphere.
|
java.lang.String |
getName()
The name to be drawn in the arena at this bot's position.
|
java.awt.Color |
getNameColor()
At the bot's position a writing is drawn in that color
|
protected Vector |
getPosOfBestBot()
The position of the currently leading
JRobot is known. |
protected double |
getTime()
The time like it is presented in the timeline slider in the GUI.
|
java.awt.Color |
getTurretColor()
Color filter for the tank's turret
|
protected void |
init()
This method is called once if the bot is set into the arena and whenever the pilot needs to be reset.
|
protected static final Angle DOWN
Angle
is 90°. For driving and
shooting purposes it points downwards or in south direction.protected static final Angle LEFT
Angle
is 180°. For driving and
shooting purposes it points to the left or in west direction.protected static final Angle RIGHT
Angle
is 0°. For driving and
shooting purposes it points to the right or in east direction.protected static final Angle UP
Angle
is 270°. For driving and
shooting purposes it points upwards or in north direction.public final java.awt.Color getBodyColor()
getBodyColor
in class jrobots.simulation.simulationObjects.AbstractPilot
public abstract jrobots.simulation.simulationObjects.BodyFactory getBodyFactory()
Pilot
is designed for.
Implementor is obligated to add the final modifier.
getBodyFactory
in class jrobots.simulation.simulationObjects.AbstractPilot
BodyFactory
protected TerrainType getCurrentTerrain()
JRobot
has a center mounted terrain sensor.
Use it to determine which terrain is located at the current position.TerrainType
public final double getEnergy()
Die Brennstoffzelle des Bots generiert mit der Zeit neue Energie. Energie kann aufgespart werden, aber bei höheren Ladeständen verpufft einiges davon.
getEnergy
in class jrobots.simulation.simulationObjects.AbstractPilot
public final double getHealth()
Panzer
s reicht von 0.0 (nächster
Treffer verschrottet Panzer) bis 1.0 (voll intakt). Sinkt der Zustand
unter einen Wert von 0.0, so ist der Kampf für diesen Panzer zu
Ende.getHealth
in class jrobots.simulation.simulationObjects.AbstractPilot
protected boolean getIsMovingInWrongDirection()
isMovingInWrongDirection
public final java.lang.String getName()
getName
in class jrobots.simulation.simulationObjects.AbstractPilot
public final java.awt.Color getNameColor()
getNameColor
in class jrobots.simulation.simulationObjects.AbstractPilot
protected Vector getPosOfBestBot()
JRobot
is known.protected final double getTime()
public final java.awt.Color getTurretColor()
getTurretColor
in class jrobots.simulation.simulationObjects.AbstractPilot
protected void init()
Please remember: If you overwrite this routine, call super.init().
init
in class jrobots.simulation.simulationObjects.AbstractPilot