|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.c5corp.c5Algorithms.AbstractHiker
public abstract class AbstractHiker
The Abstract Hiker class it the parent to all hikers. It contains static final members and utility methods unique to all hikers.
Field Summary | |
---|---|
protected static int[] |
CARDINAL_BITS
CARDINAL_BITS, which also include intercardinal primary directions, are arranged declared in the array in the following order: {N_BIT,NE_BIT,E_BIT,SE_BIT,S_BIT,SW_BIT,W_BIT,NW_BIT}. |
protected static int[][] |
MOVE
The array MOVE can be indexed into for pairs (of two element arrays) that move the hiker through the table (the landscape) based on the corresponding index into CARDINAL_BITS. |
protected UtmCoordinatePairElev[][] |
table
All hikers are assumed to have a table of representing the landscape that the Virtual Hiker will hike through. |
Constructor Summary | |
---|---|
AbstractHiker()
|
Method Summary | |
---|---|
protected static int |
calculateAzimuth(UtmCoordinatePairElev begin,
UtmCoordinatePairElev destination)
Returns an int from 0 to 359 representing the azimuth angle between Point begin and Point destination. |
protected static int |
calculateCardinalDirection(UtmCoordinatePairElev begin,
UtmCoordinatePairElev destination)
Returns the closest of eight CARDINAL_BITS representing the azimuth from UtmCoordinatePairElev begin to UtmCoordinatePairElev destination. |
protected static int |
getCardinalIndex(int direction)
Protected helper method to index into the protected parallel array MOVE for the index of a directional x,y coordinate pair describing a move through the grid. |
static double |
getDistance(UtmCoordinatePair one,
UtmCoordinatePair two)
getDistance is a utility method returning the distance between two UtmCoordinatePair objects. |
UtmCoordinatePairElev[][] |
getTable()
All hikers (children of AbstractHiker) have a table of representing the landscape that the Virtual Hiker will hike through. |
abstract VirtualHikerTrackLog |
getTrack()
Returns a VirtualHikerTrackLog object containing the results of a artificial hiking algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected UtmCoordinatePairElev[][] table
protected static final int[] CARDINAL_BITS
protected static final int[][] MOVE
table
,
MOVE
,
CARDINAL_BITS
Constructor Detail |
---|
public AbstractHiker()
Method Detail |
---|
public abstract VirtualHikerTrackLog getTrack()
protected static int getCardinalIndex(int direction)
direction
- the index into CARDINAL_BITS representing the direction
MOVE
,
CARDINAL_BITS
,
table
protected static int calculateCardinalDirection(UtmCoordinatePairElev begin, UtmCoordinatePairElev destination)
begin
- UtmCoordinatePairElev object representing the current locationdestination
- UtmCoordinatePairElev object representing the place we want to go
CARDINAL_BITS
,
calculateAzimuth(UtmCoordinatePairElev begin, UtmCoordinatePairElev destination)
protected static int calculateAzimuth(UtmCoordinatePairElev begin, UtmCoordinatePairElev destination)
begin
- UtmCoordinatePairElev object representing the current locationdestination
- UtmCoordinatePairElev object representing the place we want to go
calculateAzimuth(UtmCoordinatePairElev begin, UtmCoordinatePairElev destination)
public static double getDistance(UtmCoordinatePair one, UtmCoordinatePair two)
one
- the first coordinatetwo
- the first coordinate
public UtmCoordinatePairElev[][] getTable()
VirtualHikerTrackLog
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |