|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjrobots.simulation.simulationObjects.Pilot
public abstract class Pilot
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.
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 Panzer s 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 |
---|
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.
public int memoryConsumption
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.
Constructor Detail |
---|
public Pilot()
Method Detail |
---|
protected abstract void actions()
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:
getPosition
, getOrientation
,
getVelocity
, getTime
getLastScanResult
, isScanFromNow
,
isScannerUpdated
, getTimeOfLastScan
,
getScanInterval
getTimeOfLastShot
,
getProjectileSpeed
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:
setAutopilot
, setTrackspeedLeft
,
setTrackspeedRight
setScanDirection
, setScanAperture
setCannonCommand
setDebugText
, setDebugLines
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.
public final java.awt.Color getBodyColor()
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.
public 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.
public final java.awt.Color getNameColor()
@Deprecated protected static double getSafeShootDistance()
protected final double getTime()
public final java.awt.Color getTurretColor()
protected void init()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |