Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

VAPoints Class Reference

Represents a set of points on the field. More...

#include <VAPoints.h>

Collaboration diagram for VAPoints:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { MIN_HEIGHT_FOR_MAX_VALIDITY = 4 }
 minimum height of maximum to get maximal validity More...

enum  { GRID_SPACING = 100 }
 The space between grid points. More...

enum  { NUMBER_OF_GRID_POINTS_X = (xPosFrontFlags - xPosBackFlags) / GRID_SPACING }
 The number of grid points in x-direction. More...

enum  { NUMBER_OF_GRID_POINTS_Y = (yPosLeftFlags - yPosRightFlags) / GRID_SPACING }
 The number of grid points in y-direction. More...

enum  { FADE_OUT_TIME2 = 6000 }

Public Member Functions

 VAPoints (int numberOfVAPoints=100, int numberOfMaxima=4)
 Constructor.

 ~VAPoints ()
 Destructor.

void addPoint (int x, int y, double validity, unsigned long timestamp)
 Adds a point to the set, if necessary an old point is overwritten.

int findInsertPos ()
 Returns the index of the next position in the set, where a point can be added/set.

void searchMaxima ()
 Searches maxima of points on the field.

bool getMaximum (int index, int &x_position, int &y_position, double &validity)
 Gets the position of a maximum and stores the coordinates in x_position and y_position.

void pointsToField ()
 Adds the points to the field.

void updateGridByPoint (int xPos, int yPos, double relevance)
 Updates the grid with one point.

void incrementGridPoint (int xIndex, int yIndex, double increment)
 Increments a value in the grid.

void getGridIndices (int xPos, int yPos, int &xIndex, int &yIndex)
 Get indices of the grid for positions on the field.

void getFieldPoints (int xIndex, int yIndex, int &xPos, int &yPos)
 Get positions on the field for indices of the grid.

bool isLokMax (int xIndex, int yIndex)
 Tests if the specified grid point is a lokal maxima.


Public Attributes

VAPointpoints
 The Set of Points.

int numberOfVAPoints
 The number of points in the set.

double field [NUMBER_OF_GRID_POINTS_X][NUMBER_OF_GRID_POINTS_Y]
 The grid representing the field.

Maximummaxima
 The maxima on field.

int numberOfMaxima
 Number of maxima on field.

unsigned long timeOfLastMaximaSearch

Detailed Description

Represents a set of points on the field.

Definition at line 69 of file VAPoints.h.


Member Enumeration Documentation

anonymous enum
 

minimum height of maximum to get maximal validity

Enumeration values:
MIN_HEIGHT_FOR_MAX_VALIDITY 

Definition at line 74 of file VAPoints.h.

anonymous enum
 

The space between grid points.

Enumeration values:
GRID_SPACING 

Definition at line 76 of file VAPoints.h.

anonymous enum
 

The number of grid points in x-direction.

Enumeration values:
NUMBER_OF_GRID_POINTS_X 

Definition at line 78 of file VAPoints.h.

anonymous enum
 

The number of grid points in y-direction.

Enumeration values:
NUMBER_OF_GRID_POINTS_Y 

Definition at line 80 of file VAPoints.h.

anonymous enum
 

Enumeration values:
FADE_OUT_TIME2 

Definition at line 82 of file VAPoints.h.


Constructor & Destructor Documentation

VAPoints::VAPoints int  numberOfVAPoints = 100,
int  numberOfMaxima = 4
 

Constructor.

Definition at line 20 of file VAPoints.cpp.

References SystemCall::getCurrentSystemTime(), maxima, VAPoint::relevance, and timeOfLastMaximaSearch.

Here is the call graph for this function:

VAPoints::~VAPoints  ) 
 

Destructor.

Definition at line 46 of file VAPoints.cpp.

References maxima.


Member Function Documentation

void VAPoints::addPoint int  x,
int  y,
double  validity,
unsigned long  timestamp
 

Adds a point to the set, if necessary an old point is overwritten.

Parameters:
x The x coordinate of the point
y The y coordinate of the point
validity The validity of the point
timestamp The timestamp of the point

Definition at line 52 of file VAPoints.cpp.

References FADE_OUT_TIME2, SystemCall::getTimeSince(), and updateGridByPoint().

Referenced by GT2004PlayersLocator::addOppPlayerPercepts(), GT2004PlayersLocator::addOwnPlayerPercepts(), and GT2004PlayersLocator::execute().

Here is the call graph for this function:

int VAPoints::findInsertPos  ) 
 

Returns the index of the next position in the set, where a point can be added/set.

Returns:
The index of the next position

Definition at line 75 of file VAPoints.cpp.

References VAPoint::getRelevance(), and numberOfVAPoints.

Here is the call graph for this function:

void VAPoints::searchMaxima  ) 
 

Searches maxima of points on the field.

Definition at line 93 of file VAPoints.cpp.

References FADE_OUT_TIME2, SystemCall::getCurrentSystemTime(), SystemCall::getTimeSince(), Maximum::height, isLokMax(), maxima, MIN_HEIGHT_FOR_MAX_VALIDITY, numberOfMaxima, timeOfLastMaximaSearch, Maximum::x, and Maximum::y.

Referenced by GT2004PlayersLocator::execute().

Here is the call graph for this function:

bool VAPoints::getMaximum int  index,
int &  x_position,
int &  y_position,
double &  validity
 

Gets the position of a maximum and stores the coordinates in x_position and y_position.

The parameter index is limited. If no maximum with that index exists, the return value is false.

Parameters:
index The index of the maximum
x_position A reference to the varible storing the x coordinat
y_position A reference to the varible storing the y coordinat
validity A reference to the varible storing the validity
Returns:
True, if there is an obstacle at the given index, otherwise false

Definition at line 179 of file VAPoints.cpp.

References getFieldPoints(), Maximum::height, maxima, MIN_HEIGHT_FOR_MAX_VALIDITY, and numberOfMaxima.

Referenced by GT2004PlayersLocator::execute().

Here is the call graph for this function:

void VAPoints::pointsToField  ) 
 

Adds the points to the field.

Definition at line 202 of file VAPoints.cpp.

References numberOfVAPoints, and updateGridByPoint().

Here is the call graph for this function:

void VAPoints::updateGridByPoint int  xPos,
int  yPos,
double  relevance
 

Updates the grid with one point.

Parameters:
xPos The x coordinat on the field
yPos The y coordinat on the field
relevance The relevance of the point to add

Definition at line 221 of file VAPoints.cpp.

References GAUSS0, getGridIndices(), and incrementGridPoint().

Referenced by addPoint(), and pointsToField().

Here is the call graph for this function:

void VAPoints::incrementGridPoint int  xIndex,
int  yIndex,
double  increment
 

Increments a value in the grid.

Parameters:
xIndex The x index of the grid
yIndex The y index of the grid
increment The increment for this position in the grid

Definition at line 310 of file VAPoints.cpp.

References MIN_HEIGHT_FOR_MAX_VALIDITY.

Referenced by updateGridByPoint().

void VAPoints::getGridIndices int  xPos,
int  yPos,
int &  xIndex,
int &  yIndex
 

Get indices of the grid for positions on the field.

Parameters:
xPos The x coordinat on the field
yPos The y coordinat on the field
xIndex A reference to the variable storing the x index of the grid
yIndex A reference to the variable storing the y index of the grid

Definition at line 322 of file VAPoints.cpp.

Referenced by updateGridByPoint().

void VAPoints::getFieldPoints int  xIndex,
int  yIndex,
int &  xPos,
int &  yPos
 

Get positions on the field for indices of the grid.

Parameters:
xIndex The x index of the grid
yIndex The y index of the grid
xPos A reference to the variable storing the x coordinat on the field
yPos A reference to the variable storing the y coordinat on the field

Definition at line 339 of file VAPoints.cpp.

Referenced by getMaximum().

bool VAPoints::isLokMax int  xIndex,
int  yIndex
 

Tests if the specified grid point is a lokal maxima.

Parameters:
xIndex The x index of the grid
yIndex The y index of the grid

Definition at line 345 of file VAPoints.cpp.

Referenced by searchMaxima().


Member Data Documentation

VAPoint* VAPoints::points
 

The Set of Points.

Definition at line 171 of file VAPoints.h.

Referenced by operator<<(), and operator>>().

int VAPoints::numberOfVAPoints
 

The number of points in the set.

Definition at line 173 of file VAPoints.h.

Referenced by findInsertPos(), operator<<(), operator>>(), and pointsToField().

double VAPoints::field[NUMBER_OF_GRID_POINTS_X][NUMBER_OF_GRID_POINTS_Y]
 

The grid representing the field.

Definition at line 176 of file VAPoints.h.

Maximum* VAPoints::maxima
 

The maxima on field.

Definition at line 178 of file VAPoints.h.

Referenced by getMaximum(), searchMaxima(), VAPoints(), and ~VAPoints().

int VAPoints::numberOfMaxima
 

Number of maxima on field.

Definition at line 180 of file VAPoints.h.

Referenced by getMaximum(), and searchMaxima().

unsigned long VAPoints::timeOfLastMaximaSearch
 

Definition at line 182 of file VAPoints.h.

Referenced by searchMaxima(), and VAPoints().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:12:11 2004 for GT2004 by doxygen 1.3.6