com.c5corp.c5Algorithms
Class McpHiker

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

public class McpHiker
extends AbstractHiker

The McpHiker class implements a maximum-cost-path seeking virtual hiker. It maximizes elevation change between the start coordinates and the target using a stepwise approach looking one step ahead.

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

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

McpHiker

public McpHiker(int zone,
                java.lang.String zoneChar,
                UtmCoordinatePair start,
                UtmCoordinatePair target,
                int padding,
                java.sql.Connection connection)
Creates an McpHiker from the UTM zone, grid zone designation character (GZD), 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)
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

McpHiker

public McpHiker(int zone,
                java.lang.String zoneChar,
                UtmCoordinatePair start,
                UtmCoordinatePair target,
                java.sql.Connection connection)
Creates an McpHiker from the UTM zone, grid zone designation character (GZD), the starting and target point, with a default padding of 2000 meters around the rectangular area specified. (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)
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

getTrack

public VirtualHikerTrackLog getTrack()
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 maximizing 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 MCP results in complex terrain, often identifying ridges, sadles, and falling from cliffs. If any Virtual Hiker will produce an unhikable path, this is it. Returns null of the area is not available for analysis.

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

getUtmCoordinatePairElevArray

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