com.c5corp.c5Algorithms
Class LcpHiker

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

public class LcpHiker
extends AbstractHiker

The LcpHiker class contains methods that implement various lowest-cost-path seeking virtual hikers. The three and five degree of freedom hikers attempt to find a path that minimizes elevation change between the start coordinates and the target. Both use a stepwise approach looking only one step ahead, in various directions. Thus, they do not search the whole terrain, but normally do produce reasonable low cost path results. The one degree of freedom hiker essentially walks straight to the target point regardless of terrain. (This may often be the optimum path in flatter terrains.) The getTrack() method runs all three and returns the best result. Note: the much more computationally expensive SlopeReductionHiker often produces better LCPs for hiking.

Since:
2.0
Author:
Brett Stalbaum Copyright 2002-2006 see LICENSE.txt and UCSD_LICENSE.txt
See Also:
SlopeReductionHiker

Field Summary
static int MINIMIZE_CUMULATIVE_DISTANCE
           
static int MINIMIZE_CUMULATIVE_ELEVATION
           
static int MINIMIZE_SLOPE
           
static int MINIMIZE_STANDARD_DEVIATION
           
 
Fields inherited from class com.c5corp.c5Algorithms.AbstractHiker
CARDINAL_BITS, MOVE, table
 
Constructor Summary
LcpHiker(int zone, java.lang.String zoneChar, UtmCoordinatePair start, UtmCoordinatePair target, java.sql.Connection connection)
          Creates an LcpHiker from the UTM zone, the zone desigination character, the starting and target point, with a default padding of 1000 meters around the rectangular area specified.
LcpHiker(int zone, java.lang.String zoneChar, UtmCoordinatePair start, UtmCoordinatePair target, int padding, java.sql.Connection connection)
          Creates an LcpHiker from the UTM zone, the grid zone designation character (GZD), the UTM zone char, the starting and target coordinates, and some padding (in meters) around the rectangular area specified by the two points.
 
Method Summary
 VirtualHikerTrackLog getFiveDegreeTrack()
          Returns a VirtualHikerTrackLog object containing the results of a "five degree of freedom" artificial hiking algorithm.
 VirtualHikerTrackLog getOneDegreeTrack()
          Returns a VirtualHikerTrackLog object containing the results of a "one degree of freedom" artificial hiking algorithm.
 VirtualHikerTrackLog getThreeDegreeTrack()
          Returns a VirtualHikerTrackLog object containing the results of a "three degree of freedom" artificial hiking algorithm.
 VirtualHikerTrackLog getTrack()
          Deprecated. simply calls getTrack(LcpHiker.MINIMIZE_CUMULATIVE_ELEVATION)
 VirtualHikerTrackLog getTrack(int efficiencyType)
          Returns a VirtualHikerTrackLog object containing the results of a artificial hiking algorithm.
 UtmCoordinatePairElev[][] getUtmCoordinatePairElevArray()
          The LcpHiker 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
 

Field Detail

MINIMIZE_SLOPE

public static final int MINIMIZE_SLOPE
See Also:
getTrack(int efficiencyType), Constant Field Values

MINIMIZE_CUMULATIVE_DISTANCE

public static final int MINIMIZE_CUMULATIVE_DISTANCE
See Also:
getTrack(int efficiencyType), Constant Field Values

MINIMIZE_CUMULATIVE_ELEVATION

public static final int MINIMIZE_CUMULATIVE_ELEVATION
See Also:
getTrack(int efficiencyType), Constant Field Values

MINIMIZE_STANDARD_DEVIATION

public static final int MINIMIZE_STANDARD_DEVIATION
See Also:
getTrack(int efficiencyType), Constant Field Values
Constructor Detail

LcpHiker

public LcpHiker(int zone,
                java.lang.String zoneChar,
                UtmCoordinatePair start,
                UtmCoordinatePair target,
                int padding,
                java.sql.Connection connection)
Creates an LcpHiker from the UTM zone, the grid zone designation character (GZD), the UTM zone char, the starting and target coordinates, and some padding (in meters) around the rectangular area specified by the two points. 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) - if you don't know it exactly, try one nearby, or in your hemisphere.
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:
DbHelper

LcpHiker

public LcpHiker(int zone,
                java.lang.String zoneChar,
                UtmCoordinatePair start,
                UtmCoordinatePair target,
                java.sql.Connection connection)
Creates an LcpHiker from the UTM zone, the zone desigination character, the starting and target point, with a default padding of 1000 meters around the rectangular area specified. 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:
DbHelper
Method Detail

getOneDegreeTrack

public VirtualHikerTrackLog getOneDegreeTrack()
Returns a VirtualHikerTrackLog object containing the results of a "one degree of freedom" artificial hiking algorithm. The virtual hiker is constrained to a bearing heading more or less directly from the start point to the target point, regardless of terrain. It generally yields great results for flatter terrains. Returns null of the area is not available for analysis.

Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike

getThreeDegreeTrack

public VirtualHikerTrackLog getThreeDegreeTrack()
Returns a VirtualHikerTrackLog object containing the results of a "three degree of freedom" artificial hiking algorithm. The virtual hiker is constrained to a bearing heading either directly to the location, or to a intercardinal direction to the right and left of the optimum direction. (These are the three degrees of freedom.) The choice of direction is made based on minimizing elevation change. If it can not escape a cycle, it returns from where it entered a the cycle, and the arrivedAtTaget() method will return false. This method generally yields the good LCP results in complex terrain, often identifying water courses. Returns null of the area is not available for analysis.

Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike
See Also:
VirtualHikerTrackLog

getFiveDegreeTrack

public VirtualHikerTrackLog getFiveDegreeTrack()
Returns a VirtualHikerTrackLog object containing the results of a "five degree of freedom" artificial hiking algorithm. The virtual hiker is constrained to a bearing heading either directly to the location, or to the two intercardinal directions to the right and left of the optimum direction. (These are the five degrees of freedom.) The choice of direction is made based on minimizing elevation change. Warning: sometimes does not escape cycles, and when it does manage to produce a track, it is typically chaotic, inefficient, and quite interesting. If it can not escape a cycle, it returns from where it entered a the cycle, and the arrivedAtTaget() method will return false. Returns null of the area is not available for analysis.

Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike

getTrack

public VirtualHikerTrackLog getTrack()
Deprecated. simply calls getTrack(LcpHiker.MINIMIZE_CUMULATIVE_ELEVATION)

Returns a VirtualHikerTrackLog object containing the results of a artificial hiking algorithm. It picks the most efficient track from the results of running the one, three and five degree of freedom algorithms. What is the most efficient track? It depends on your definition. Static variables defined in this class allow the selection of different attributes of the class to minimize when passed as an argument to this method. This method is deprecated. Use public VirtualHikerTrackLog getTrack(int efficiencyType). This simply calls getTrack(LcpHiker.MINIMIZE_CUMULATIVE_ELEVATION).

Specified by:
getTrack in class AbstractHiker
Returns:
a VirtualHikerTrackLog representing the virtual hike
See Also:
getTrack(int)

getTrack

public VirtualHikerTrackLog getTrack(int efficiencyType)
Returns a VirtualHikerTrackLog object containing the results of a artificial hiking algorithm. It picks the most efficient track from the results of running the one, three and five degree of freedom algorithms. What is the most efficient track? It depends on your definition. Static variables defined in this class allow the selection of different attributes of the class to minimize when passed as an argument to this method.
  1. LcpHiker.MINIMIZE_SLOPE - minimize the max slope of the track
  2. LcpHiker.MINIMIZE_CUMULATIVE_DISTANCE - minimize the cumulative distance
  3. LcpHiker.MINIMIZE_CUMULATIVE_ELEVATION - minimize the cumulative elevation change
  4. LcpHiker.MINIMIZE_STANDARD_DEVIATION - minimize the standard deviation of the track

Parameters:
efficiencyType - - the type of efficiency desired
Returns:
Returns null of the area is not available for analysis.

getUtmCoordinatePairElevArray

public UtmCoordinatePairElev[][] getUtmCoordinatePairElevArray()
The LcpHiker 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