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

LandmarksState Class Reference

A class describing detected landmarks. More...

#include <LandmarksState.h>

Collaboration diagram for LandmarksState:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { numOfLandmarks = 13 }

Public Member Functions

 LandmarksState ()
void update (const LandmarksPercept &landmarksPercept)
void reset ()
bool seenAnyBeacon () const
 return true, if a beacon was seen

bool seenAnyFlag () const
 return true, if a beacon or a flag was seen

int lastSeenBeaconIndex () const
 return the index of the last seen landmark.

long timeOfLastSeenBeacon (int beaconIndex) const
 return the time when the last beacon was seen.

long timeBetweenSeen2LastBeacons (int beaconIndex) const
 return the time difference between the two last seen beacon

void initLandmarks ()
void setLandmarkVisibleByBeaconType (int type)

Public Attributes

LandmarkState landmarks [numOfLandmarks]
int lastSeenBeacon
 the index of the last seen beacon


Static Public Attributes

const double BEACON = 1
const double GOAL = 1
const double LINE = 0.5
const double EDGE = 0.75

Detailed Description

A class describing detected landmarks.

Definition at line 21 of file LandmarksState.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
numOfLandmarks 

Definition at line 35 of file LandmarksState.h.


Constructor & Destructor Documentation

LandmarksState::LandmarksState  ) 
 

Definition at line 18 of file LandmarksState.cpp.

References initLandmarks(), lastSeenBeacon, and reset().

Here is the call graph for this function:


Member Function Documentation

void LandmarksState::update const LandmarksPercept landmarksPercept  ) 
 

Definition at line 117 of file LandmarksState.cpp.

References LandmarksPercept::flags, landmarks, LandmarksPercept::numberOfFlags, setLandmarkVisibleByBeaconType(), Flag::type, and LandmarkState::visible.

Referenced by GT2004SelfLocator::execute().

Here is the call graph for this function:

void LandmarksState::reset  ) 
 

Definition at line 64 of file LandmarksState.cpp.

References landmarks, numOfLandmarks, LandmarkState::timeWhenLastSeen, and LandmarkState::visible.

Referenced by LandmarksState().

bool LandmarksState::seenAnyBeacon  )  const
 

return true, if a beacon was seen

Definition at line 74 of file LandmarksState.cpp.

References landmarks, and LandmarkState::visible.

Referenced by seenAnyFlag().

bool LandmarksState::seenAnyFlag  )  const
 

return true, if a beacon or a flag was seen

Definition at line 82 of file LandmarksState.cpp.

References landmarks, seenAnyBeacon(), and LandmarkState::visible.

Here is the call graph for this function:

int LandmarksState::lastSeenBeaconIndex  )  const
 

return the index of the last seen landmark.

this is useful for optimizing the next two functions

Definition at line 87 of file LandmarksState.cpp.

References landmarks, and LandmarkState::timeWhenLastSeen.

Referenced by GT2004HeadControl::getLastSeenBeaconIndex().

long LandmarksState::timeOfLastSeenBeacon int  beaconIndex  )  const
 

return the time when the last beacon was seen.

the function sets up the var lastSeenBeacon

Definition at line 102 of file LandmarksState.cpp.

References landmarks, and LandmarkState::timeWhenLastSeen.

Referenced by GT2004HeadControl::getTimeOfLastSeenBeacon().

long LandmarksState::timeBetweenSeen2LastBeacons int  beaconIndex  )  const
 

return the time difference between the two last seen beacon

Definition at line 107 of file LandmarksState.cpp.

References landmarks, and min.

Referenced by GT2004HeadControl::getTimeBetweenSeen2LastBeacons().

void LandmarksState::initLandmarks  ) 
 

Definition at line 25 of file LandmarksState.cpp.

References BEACON, EDGE, getPlayer(), Player::getTeamColor(), GOAL, landmarks, and LINE.

Referenced by LandmarksState().

Here is the call graph for this function:

void LandmarksState::setLandmarkVisibleByBeaconType int  type  ) 
 

Definition at line 126 of file LandmarksState.cpp.

References LandmarkState::beaconColor, SystemCall::getCurrentSystemTime(), landmarks, LandmarkState::timeWhenLastSeen, and LandmarkState::visible.

Referenced by update().

Here is the call graph for this function:


Member Data Documentation

const double LandmarksState::BEACON = 1 [static]
 

Definition at line 13 of file LandmarksState.cpp.

Referenced by initLandmarks().

const double LandmarksState::GOAL = 1 [static]
 

Definition at line 14 of file LandmarksState.cpp.

Referenced by initLandmarks().

const double LandmarksState::LINE = 0.5 [static]
 

Definition at line 15 of file LandmarksState.cpp.

Referenced by initLandmarks().

const double LandmarksState::EDGE = 0.75 [static]
 

Definition at line 16 of file LandmarksState.cpp.

Referenced by initLandmarks().

LandmarkState LandmarksState::landmarks[numOfLandmarks]
 

Definition at line 37 of file LandmarksState.h.

Referenced by initLandmarks(), lastSeenBeaconIndex(), operator<<(), operator>>(), reset(), seenAnyBeacon(), seenAnyFlag(), setLandmarkVisibleByBeaconType(), timeBetweenSeen2LastBeacons(), timeOfLastSeenBeacon(), and update().

int LandmarksState::lastSeenBeacon
 

the index of the last seen beacon

Definition at line 40 of file LandmarksState.h.

Referenced by LandmarksState().


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