com.c5corp.c5Algorithms
Class RandomHiker

java.lang.Object
  extended by com.c5corp.c5Algorithms.AbstractHiker
      extended by com.c5corp.c5Algorithms.RandomHiker

public class RandomHiker
extends AbstractHiker

The RandomHiker class extends AbstractHiker, implementing an artificial hiking algorithm based on random choices from among three degrees of freedom (cardinal direction) in the general direction of the target or target point. It is rarely useful in one pass, as its random behavior often leads to the hiker violating its no cycle rule, at which point it returns a path marked as a failure. The main use of objects this class is as the fodder for the SlopeReductionHiker class.

Since:
2.0
See Also:
SlopeReductionHiker

Field Summary
 
Fields inherited from class com.c5corp.c5Algorithms.AbstractHiker
CARDINAL_BITS, MOVE, table
 
Constructor Summary
RandomHiker(int zone, java.lang.String zoneChar, UtmCoordinatePair start, UtmCoordinatePair target, java.sql.Connection connection)
          Creates an RandomHiker from the UTM zone, the starting and target point, some padding (in meters) around the rectangular area specified by the two points, and a Connection object.
RandomHiker(int zone, java.lang.String zoneChar, UtmCoordinatePair start, UtmCoordinatePair target, int padding, java.sql.Connection connection)
          Creates an RandomHiker from the UTM zone, the starting and target point, some padding (in meters) around the rectangular area specified by the two points, and a Connection object.
 
Method Summary
 VirtualHikerTrackLog getTrack()
          Returns a VirtualHikerTrackLog object containing the results of a run of the Random Hiker.
 UtmCoordinatePairElev[][] getUtmCoordinatePairElevArray()
          The RandomHiker class produces a UtmCoordinatePairElev[][] as part of its processing of the track.
 
Methods inherited from class com.c5corp.c5Algorithms.AbstractHiker
calculateAzimuth, calculateCardinalDirection, getCardinalIndex, getDistance, getTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomHiker

public RandomHiker(int zone,
                   java.lang.String zoneChar,
                   UtmCoordinatePair start,
                   UtmCoordinatePair target,
                   int padding,
                   java.sql.Connection connection)
Creates an RandomHiker from the UTM zone, the starting and target point, some padding (in meters) around the rectangular area specified by the two points, and a Connection object. This constructor is ideal if you have a connection object to recycle. Note that all Virtual Hikers need the grid zone designation character (GZD). If you do not know it, try using one in your hemisphere. Many GPS devices will correct.

Parameters:
zone - the UTM zone
zoneChar - the UTM grid zone designation character (GZD)
start - The starting coordinates of the virtual hiker
target - The target coordinates of the virtual hiker
padding - the number of meters to add around
connection - a connection object (see DbHelper)
See Also:
exceeding this slope.

RandomHiker

public RandomHiker(int zone,
                   java.lang.String zoneChar,
                   UtmCoordinatePair start,
                   UtmCoordinatePair target,
                   java.sql.Connection connection)
Creates an RandomHiker from the UTM zone, the starting and target point, some padding (in meters) around the rectangular area specified by the two points, and a Connection object. This constructor is ideal if you have a connection object to recycle. Note that all Virtual Hikers need the grid zone designation character (GZD). If you do not know it, try using one in your hemisphere. Many GPS devices will correct.

Parameters:
zone - the UTM zone
zoneChar - the UTM grid zone designation character (GZD)
start - The starting coordinates of the virtual hiker
target - The target coordinates of the virtual hiker
connection - a connection object (see DbHelper)
See Also:
exceeding this slope.
Method Detail

getTrack

public VirtualHikerTrackLog getTrack()
Returns a VirtualHikerTrackLog object containing the results of a run of the Random Hiker. This method will very likely return a different track each time it is called.

Specified by:
getTrack in class AbstractHiker
Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike

getUtmCoordinatePairElevArray

public UtmCoordinatePairElev[][] getUtmCoordinatePairElevArray()
The RandomHiker class produces a UtmCoordinatePairElev[][] as part of its processing of the track. This object can be useful for many things, such as imaging.

Returns:
a UtmCoordinatePairElev[][] array representing the area the vhiker searched