jrobots.simulation.simulationObjects
Class Pilot

java.lang.Object
  extended by jrobots.simulation.simulationObjects.Pilot
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JRobot2007, JRobot2008, JRobot2009, JRobot2010, JRobot2011, JRobot2012, JRobot2012_FH, JRobot2013

public abstract class Pilot
extends java.lang.Object
implements java.io.Serializable

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°.
 int memoryConsumption
          The value of this variable gives a hint at how much memory [bytes] this instance of Pilot including all its subobjects consumes.
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 Summary
Pilot()
           
 
Method Summary
protected abstract  void actions()
          Everytime the simulation has progressed, each Pilot may plan the next actions.
 java.awt.Color getBodyColor()
          Mit dieser Farbe wird das Bild des Panzerkörpers gefiltert.
 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.awt.Color getNameColor()
          ??
protected static double getSafeShootDistance()
          Deprecated. 
protected  double getTime()
          Liefert die aktuelle Zeit zurück.
 java.awt.Color getTurretColor()
          Mit dieser Farbe wird das Bild des Panzerturms gefiltert.
protected  void init()
          Diese Methode wird einmalig aufgerufen, nachdem der Bot in die Arena gesetzt wird und bevor der Kampf startet.
 
Methods inherited from class java.lang.Object
clone, 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.


memoryConsumption

public int memoryConsumption
The value of this variable gives a hint at how much memory [bytes] this instance of Pilot including all its subobjects consumes.


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

actions

protected abstract void actions()
Everytime the simulation has progressed, each Pilot may plan the next actions. This is done through execution of this method.

Knowledge a Pilot has of the momentary simulation state is limited to what its Panzer's sensors may display. Access to the Panzer's sensor states is best done via the following methods:

A Pilot is able to steer its Panzer. The Panzer will follow those decisions until the Pilot canges its commands. Decisions are made by calling the following routines:

You may add fields as you like to keep some state through the coarse of the simulation run. But remember not to waste memory, as the framework checks the size of your Pilot's state and may refuse to permit it to the arena.
You can always use static fields, but that makes the timeline slider obsolete for debugging.

Also keep track of the computing time you spend, because if you exeed a certain treshold, the framework may exert punishment upon your Pilot. If you try to not waste time, there shouldn't be a problem, however.
If your Pilot causes an exception, there will also be some detriment, but a new instance of your Pilot will be established, so you may be able to carry on.


getBodyColor

public final java.awt.Color getBodyColor()
Mit dieser Farbe wird das Bild des Panzerkörpers gefiltert.

Returns:
Farbe des Körpers des Panzers

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.


getHealth

public 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.

Returns:
momentanen Panzerzustand element [0.0, 1.0]

getNameColor

public final java.awt.Color getNameColor()
??ber dem Bot steht ein Schriftzug aus dem Namen des Bots in dieser Farbe.

Returns:
Gibt die Farbe des Botnamen zurück.

getSafeShootDistance

@Deprecated
protected static double getSafeShootDistance()
Deprecated. 

As projectiles no longer affect Panzers in the vicinity of their explosion, this method exists for compatibility issues only.

Returns:
[m]

getTime

protected final double getTime()
Liefert die aktuelle Zeit zurück.

Returns:
Zeit seit Matchbeginn in Sekunden.

getTurretColor

public final java.awt.Color getTurretColor()
Mit dieser Farbe wird das Bild des Panzerturms gefiltert.

Returns:
Farbe des Turms des Panzers

init

protected void init()
Diese Methode wird einmalig aufgerufen, nachdem der Bot in die Arena gesetzt wird und bevor der Kampf startet.