jrobots.simulation.simulationObjects
Class JRobot2016A

java.lang.Object
  extended by jrobots.simulation.simulationObjects.AbstractPilot
      extended by jrobots.simulation.simulationObjects.Pilot
          extended by jrobots.simulation.simulationObjects.JRobot2016A
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EmptyRacer, RacerFollower, RacerScannerWithMemory, RacerTerrainScanner, RaconatorMk4

public abstract class JRobot2016A
extends Pilot

By using the rules for the race course, every implementing pilot enters a new land of competition, as it is the first time a JRobots race takes place.

See Also:
actions(), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jrobots.simulation.simulationObjects.Pilot
Pilot.DropperCommand, Pilot.LauncherAmmunition
 
Field Summary
 
Fields inherited from class jrobots.simulation.simulationObjects.Pilot
DOWN, LEFT, RIGHT, UP
 
Fields inherited from class jrobots.simulation.simulationObjects.AbstractPilot
memoryConsumption
 
Constructor Summary
JRobot2016A()
           
 
Method Summary
protected abstract  void actions()
          At every simulation cycle every JRobot plans its next actions.
protected  void addDebugArrow(Vector start, Vector end)
          Mit Hilfe dieser Funktion kann ein Bot einen Pfeil auf's Spielfeld zeichnen.
protected  void addDebugCrosshair(Vector position)
          Mit Hilfe dieser Funktion kann ein Bot ein Kreuz auf's Spielfeld zeichnen.
protected  void addDebugLine(float x1, float y1, float x2, float y2)
           
protected  void addDebugLine(Vector p1, Vector p2)
          Mit Hilfe dieser Funktion kann ein Bot eine Linie auf's Spielfeld zeichnen.
protected static Angle down()
          Dieser Winkel hat den Wert 90° oder 1/2 Pi.
 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.
protected static double getEnergyConsumptionEngine()
          Each tyre is accelerated by an electric motor.
protected static double getEnergyProductionPerSecond()
          The vehicle is powered by a fuel cell.
protected static int getFramesPerSecond()
          The exact number of frames per second.
protected static double getMaxBackwardVelocity()
           
protected static double getMaxForwardVelocity()
           
protected  Angle getOrientation()
          Liefert die aktuelle Ausrichtung des Rumpfes.
protected  Vector getPosition()
          Liefert die aktuelle absolute Position des JRobot in der Arena.
protected  Vector getPosOfBestBot()
          The position of the currently leading JRobot is known.
protected  Vector getVelocity()
          Liefert den aktuellen Geschwindigkeitsvektor des Bots.
protected static Angle left()
          Dieser Winkel hat den Wert 180° oder Pi.
protected static Angle right()
          Dieser Winkel hat den Wert 0° oder 0 Pi.
protected  void setAutopilot(Angle direction, double speed)
          Diese Funktion aktiviert den Autopilot, welcher selbständig die Geschwindigkeiten der beiden Panzerketten regelt.
protected  void setBodyColor(java.awt.Color newColor)
          Hiermit kann eine Farbe eingestellt werden, mit der das Bild des Rumpfes gefiltert wird.
protected  void setBoost()
          Zündet einen mächtigen Booster, der den JRobot einen Satz nach vorne machen lässt.
protected  void setDebugLines(Vector[] points)
          Mit Hilfe dieser Funktion kann ein Bot mehrere Linien auf's Spielfeld zeichnen.
protected  void setNameColor(java.awt.Color newNameColor)
          Hiermit kann die Farbe des Schriftzuges verändert werden, der in der Arena über dem Bot angezeigt wird.
protected static Angle up()
          Dieser Winkel hat den Wert 270° oder 3/2 Pi.
 
Methods inherited from class jrobots.simulation.simulationObjects.Pilot
getBodyColor, getEnergy, getHealth, getName, getNameColor, getTime, getTurretColor, init
 
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
 

Constructor Detail

JRobot2016A

public JRobot2016A()
Method Detail

actions

protected abstract void actions()
At every simulation cycle every JRobot plans its next actions. This happens by the framework calling this method.
Every participant is programming the decisions the JRobot will take in any possible situation. The following allotment of methods will help you in doing so.

Every JRobot has only limited knowledge of its surroundings. That limit is set by its sensors. Sensors in general are methods starting with get...:

The JRobot is called for actions, which are will have effect in the next simulation cycle. Issued actions in general are methods starting with set...:

In package jrobots.utils there are several helper classes to be used as necessary.

You may want to add fields to your JRobot class.

While it is possible to use static fields, these are not affected by the timeline slider in the GUI, which makes debugging less practical. Please don't use static fields while you can avoid it.

Runtime and memory are watched by the framework. If a reasonable use of the framework is confined by your programming, the responsible JRobot may be expelled from the competition.
Exceptions will be caught by the framework and the JRobot will be restarted. Please be aware of exceptions on the console, as the robot loses its memory at every restart.


addDebugArrow

protected final void addDebugArrow(Vector start,
                                   Vector end)
Description copied from class: Pilot
Mit Hilfe dieser Funktion kann ein Bot einen Pfeil auf's Spielfeld zeichnen. Der Pfeil wird in der Farbe des Botnamens gemalt.

Alle Debug-Linien sind jeweils nur in dem Frame sichtbar, in dem sie hinzugefügt wurden. Für eine längere Anzeige müssen die Linien also in jedem Frame neu gesetzt werden.


addDebugCrosshair

protected final void addDebugCrosshair(Vector position)
Description copied from class: Pilot
Mit Hilfe dieser Funktion kann ein Bot ein Kreuz auf's Spielfeld zeichnen. Das Kreuz wird in der Farbe des Botnamens gemalt.

Alle Debug-Linien sind jeweils nur in dem Frame sichtbar, in dem sie hinzugefügt wurden. Für eine längere Anzeige müssen die Linien also in jedem Frame neu gesetzt werden.

Parameters:
position - die Position des Kreuzes

addDebugLine

protected final void addDebugLine(float x1,
                                  float y1,
                                  float x2,
                                  float y2)

addDebugLine

protected final void addDebugLine(Vector p1,
                                  Vector p2)
Description copied from class: Pilot
Mit Hilfe dieser Funktion kann ein Bot eine Linie auf's Spielfeld zeichnen. Die Linie wird in der Farbe des Botnamens gemalt.

Alle Debug-Linien sind jeweils nur in dem Frame sichtbar, in dem sie hinzugefügt wurden. Für eine längere Anzeige müssen die Linien also in jedem Frame neu gesetzt werden.

Parameters:
p1 - Startpunkt der Linie
p2 - Endpunkt der Linie

down

protected static final Angle down()
Dieser Winkel hat den Wert 90° oder 1/2 Pi.

Returns:
Winkel nach unten / Süden

getBodyFactory

public final jrobots.simulation.simulationObjects.BodyFactory getBodyFactory()
Description copied from class: Pilot
determines the favorite supplier this Pilot is designed for.

Implementor is obligated to add the final modifier.

Specified by:
getBodyFactory in class Pilot
Returns:
the BodyFactory

getCurrentTerrain

protected final TerrainType getCurrentTerrain()
Description copied from class: Pilot
The JRobot has a center mounted terrain sensor. Use it to determine which terrain is located at the current position.

Overrides:
getCurrentTerrain in class Pilot
Returns:
TerrainType

getEnergyConsumptionEngine

protected static final double getEnergyConsumptionEngine()
Each tyre is accelerated by an electric motor. This is the maximum overall power consumption of all motors.

Returns:
consumed energy per second [E/s]

getEnergyProductionPerSecond

protected static final double getEnergyProductionPerSecond()
The vehicle is powered by a fuel cell. This is the nominal energy produced without storage loss.

Returns:
produced energy per second [E/s]

getFramesPerSecond

protected static final int getFramesPerSecond()
The exact number of frames per second.

Returns:
frames per second; without unit []

getMaxBackwardVelocity

protected static final double getMaxBackwardVelocity()

getMaxForwardVelocity

protected static final double getMaxForwardVelocity()

getOrientation

protected final Angle getOrientation()
Description copied from class: Pilot
Liefert die aktuelle Ausrichtung des Rumpfes.
Dieser Wert stimmt nicht immer genau mit dem Winkel des Geschwindigkeitsvektors überein, da der Bot auch seitlich rutschen kann (z.B. in Kurven).

Returns:
aktuelle Ausrichtung im Bogenmaß

getPosition

protected final Vector getPosition()
Description copied from class: Pilot
Liefert die aktuelle absolute Position des JRobot in der Arena.

Returns:
Position des Panzers - wie alles gemessen in Metern

getPosOfBestBot

protected final Vector getPosOfBestBot()
Description copied from class: Pilot
The position of the currently leading JRobot is known.

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

getVelocity

protected final Vector getVelocity()
Description copied from class: Pilot
Liefert den aktuellen Geschwindigkeitsvektor des Bots. Dieser ist nicht notwendigerweise exakt gleich der Ausrichtung. Der Panzer kann ein bisschen rutschen.

Returns:
aktuelle Bewegungsrichtung als Geschwindigkeitsvektor [m/s]

left

protected static final Angle left()
Dieser Winkel hat den Wert 180° oder Pi.

Returns:
Winkel nach links / Westen

right

protected static final Angle right()
Dieser Winkel hat den Wert 0° oder 0 Pi.

Returns:
Winkel nach rechts / Osten

setAutopilot

protected final void setAutopilot(Angle direction,
                                  double speed)
Description copied from class: Pilot
Diese Funktion aktiviert den Autopilot, welcher selbständig die Geschwindigkeiten der beiden Panzerketten regelt.
Der Autopilot fährt so lange mit der angegebenen Geschwindigkeit in die angegebene Richtung, bis diese Funktion mit neuen Daten nochmals aufgerufen wird.

Hinweis: Der Bot kann vorwärts schneller als rückwärts fahren.

Parameters:
direction - gewünschte Fahrtrichtung - in diese Richtung soll die Front zeigen.
speed - gewünschte Geschwindigkeit im Intervall [-1...+1]. Werte kleiner als Null fahren rückwärts

setBodyColor

protected final void setBodyColor(java.awt.Color newColor)
Description copied from class: Pilot
Hiermit kann eine Farbe eingestellt werden, mit der das Bild des Rumpfes gefiltert wird. Voreinstellung: Weiß (für keinen Filter). Der Alpha-Wert der gewünschten Farbe wird ignoriert.


setBoost

protected final void setBoost()
Description copied from class: Pilot
Zündet einen mächtigen Booster, der den JRobot einen Satz nach vorne machen lässt.

Selbstverständlich kostet das weit mehr Energie als auf dorthin auf gewöhnlichen Ketten zu gelangen, aber so kann der Bot seine Maximalgeschwindigkeit übertreffen.

Der Booster brennt einige Simulationszyklen lang, bevor er automatisch erlischt.


setDebugLines

protected final void setDebugLines(Vector[] points)
Description copied from class: Pilot
Mit Hilfe dieser Funktion kann ein Bot mehrere Linien auf's Spielfeld zeichnen. Die Linien werden in der Farbe des Botnamens gemalt. Die Anzahl der Linien ist beliebig. Die Methode nimmt ein Array mit den Start- und Endpunkten der Linien entgegen. Die Linien müssen nicht zusammenhüngend sein. Das übergebene Array wird wührend des Methodenaufrufs kopiert, es ist also nicht nütig, es danach unberührt zu lassen. Jeweils zwei aufeinanderfolgende Punkte werden als eine Linie interpretiert. Das Array muss also immer eine gerade Zahl von Elementen haben.

Alle Debug-Linien sind jeweils nur in dem Frame sichtbar, in dem sie hinzugefügt wurden. Für eine lüngere Anzeige müssen die Linien also in jedem Frame neu deklariert werden.

Parameters:
points - Start- und Endpunkte der Linien

setNameColor

protected void setNameColor(java.awt.Color newNameColor)
Description copied from class: Pilot
Hiermit kann die Farbe des Schriftzuges verändert werden, der in der Arena über dem Bot angezeigt wird.


up

protected static final Angle up()
Dieser Winkel hat den Wert 270° oder 3/2 Pi.

Returns:
Winkel nach oben / Norden