jrobots.simulation.simulationObjects
Class Pilot

java.lang.Object
  extended by jrobots.simulation.simulationObjects.AbstractPilot
      extended by jrobots.simulation.simulationObjects.Pilot
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JRobot2016A

public abstract class Pilot
extends jrobots.simulation.simulationObjects.AbstractPilot

A Pilot steers a Panzer.
This works as a base class for all entities that take part in the simulation.

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.

See Also:
Serialized Form

Nested Class Summary
protected static class Pilot.DropperCommand
           
protected static class Pilot.LauncherAmmunition
           
 
Field Summary
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°.
 
Fields inherited from class jrobots.simulation.simulationObjects.AbstractPilot
memoryConsumption
 
Constructor Summary
Pilot()
           
 
Method Summary
 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 Panzers reicht von 0.0 (nächster Treffer verschrottet Panzer) bis 1.0 (voll intakt).
 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.
 
Methods inherited from class jrobots.simulation.simulationObjects.AbstractPilot
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOWN

protected static final Angle DOWN
The degree value of this Angle is 90°. For driving and shooting purposes it points downwards or in south direction.


LEFT

protected static final Angle LEFT
The degree value of this Angle is 180°. For driving and shooting purposes it points to the left or in west direction.


RIGHT

protected static final Angle RIGHT
The degree value of this Angle is 0°. For driving and shooting purposes it points to the right or in east direction.


UP

protected static final Angle UP
The degree value of this Angle is 270°. For driving and shooting purposes it points upwards or in north direction.

Constructor Detail

Pilot

public Pilot()
Method Detail

getBodyColor

public final java.awt.Color getBodyColor()
This color filter is applied to the body texture

Specified by:
getBodyColor in class jrobots.simulation.simulationObjects.AbstractPilot
Returns:
color of the Panzer's body

getBodyFactory

public abstract jrobots.simulation.simulationObjects.BodyFactory getBodyFactory()
determines the favorite supplier this Pilot is designed for.

Implementor is obligated to add the final modifier.

Specified by:
getBodyFactory in class jrobots.simulation.simulationObjects.AbstractPilot
Returns:
the BodyFactory

getCurrentTerrain

protected TerrainType getCurrentTerrain()
The JRobot has a center mounted terrain sensor. Use it to determine which terrain is located at the current position.

Returns:
TerrainType

getEnergy

public final double getEnergy()
Energie wird benötigt für Fahren, Botscanner, Schießen und für den Booster. Ohne Energie keine Aktion.

Die Brennstoffzelle des Bots generiert mit der Zeit neue Energie. Energie kann aufgespart werden, aber bei höheren Ladeständen verpufft einiges davon.

Specified by:
getEnergy in class jrobots.simulation.simulationObjects.AbstractPilot

getHealth

public final double getHealth()
Der Zustand eines Panzers 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.

Specified by:
getHealth in class jrobots.simulation.simulationObjects.AbstractPilot
Returns:
momentanen Panzerzustand element [0.0, 1.0]

getName

public final java.lang.String getName()
The name to be drawn in the arena at this bot's position.

Specified by:
getName in class jrobots.simulation.simulationObjects.AbstractPilot
Returns:
class name (simple name)

getNameColor

public final java.awt.Color getNameColor()
At the bot's position a writing is drawn in that color

Specified by:
getNameColor in class jrobots.simulation.simulationObjects.AbstractPilot
Returns:
color of the writing of the bot's name

getPosOfBestBot

protected Vector getPosOfBestBot()
The position of the currently leading JRobot is known.

Returns:
position of the bot with current highest ranking in the match; global axes and global coordinates

getTime

protected final double getTime()
The time like it is presented in the timeline slider in the GUI.

Returns:
time since the beginning of the match [s]

getTurretColor

public final java.awt.Color getTurretColor()
Color filter for the tank's turret

Specified by:
getTurretColor in class jrobots.simulation.simulationObjects.AbstractPilot
Returns:
color of the turret

init

protected void init()
This method is called once if the bot is set into the arena and whenever the pilot needs to be reset.

Please remember: If you overwrite this routine, call super.init().

Specified by:
init in class jrobots.simulation.simulationObjects.AbstractPilot