com.c5corp.c5Algorithms
Class SlopeReductionHiker

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

public class SlopeReductionHiker
extends AbstractHiker

The SlopeReductionHiker class extends AbstractHiker, but it in fact marshals many, many iterations of the RandomHiker algorithm, and it selects from among the many VirtualHikerTrackLogs thus produced that most closely match the input criteria. Note that the "natural selection" process from among tracks that are produced with the randomization algorithm in RandomHiker makes the algorithms in this class very compute intensive, and often yields slightly different results depending upon the good luck of the random hikers. However, it often provides much better lowest-cost-paths than the stepwise LcpHiker. The SlopeReductionHiker getTrack() metod also utilizes progressive back-off in an attempt to deliver a satisficing track with a slope between the idealSlope argument and a slope of 58% (About 30 degrees of slope), beyond which paths may be barely traversable without ropes and mountaineering equipment, and beyond which "slope reduction" can be considered to have failed. Other methods of the class are modifications of getTrack() that provide extra capabilities, including a constaint of the slope considering the perpendicular slope of the trail as well as the linear slope.

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

Field Summary
 
Fields inherited from class com.c5corp.c5Algorithms.AbstractHiker
CARDINAL_BITS, MOVE, table
 
Constructor Summary
SlopeReductionHiker(int zone, java.lang.String zoneChar, UtmCoordinatePair start, UtmCoordinatePair target, int idealSlope, java.sql.Connection connection)
          Creates an SlopeReductionHiker from the UTM zone, zone designation character, the starting and target point, a target slope to search for, and a Connection object.
SlopeReductionHiker(int zone, java.lang.String zoneChar, UtmCoordinatePair start, UtmCoordinatePair target, int padding, int idealSlope, java.sql.Connection connection)
          Creates an SlopeReductionHiker from the UTM zone, zone designation character, the starting and target point, some padding (in meters) around the rectangular area specified by the two points, a target slope to search for, and a Connection object.
 
Method Summary
 VirtualHikerTrackLog getTrack()
          Returns a VirtualHikerTrackLog object containing the results of many, many iterations of the RandomHiker algorithm, and it selects from among the many VirtualHikerTrackLogs thus produced that most closely match the input criteria.
 VirtualHikerTrackLog getTrackPerpendicularConstraint()
          Returns a VirtualHikerTrackLog object containing the results of many, many iterations of the RandomHiker algorithm, selecting from among the many VirtualHikerTrackLogs thus produced that most closely match the input criteria.
 UtmCoordinatePairElev[][] getUtmCoordinatePairElevArray()
          The SlopeReductionHiker class produces a UtmCoordinatePairElev[][] as part of its processing of the track.
 VirtualHikerTrackLog overrideReasonableSlope(int override)
          See the getTrack method.
 
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

SlopeReductionHiker

public SlopeReductionHiker(int zone,
                           java.lang.String zoneChar,
                           UtmCoordinatePair start,
                           UtmCoordinatePair target,
                           int idealSlope,
                           java.sql.Connection connection)
Creates an SlopeReductionHiker from the UTM zone, zone designation character, the starting and target point, a target slope to search for, and a Connection object. A default value of 1000 meters is used as padding 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
idealSlope - the target slope as a percentage
connection - a connection object (see DbHelper)
See Also:
DbHelper

SlopeReductionHiker

public SlopeReductionHiker(int zone,
                           java.lang.String zoneChar,
                           UtmCoordinatePair start,
                           UtmCoordinatePair target,
                           int padding,
                           int idealSlope,
                           java.sql.Connection connection)
Creates an SlopeReductionHiker from the UTM zone, zone designation character, the starting and target point, some padding (in meters) around the rectangular area specified by the two points, a target slope to search for, and a Connection object. Note that the Slope reduction hiker needs padding to work properly. If less than 1000, a default padding of 1000 will be used anyway. 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 the area - If less than 1000, a default padding of 1000 will be used.
idealSlope - the target slope as a percentage
connection - a connection object (see DbHelper)
See Also:
DbHelper
Method Detail

getTrack

public VirtualHikerTrackLog getTrack()
Returns a VirtualHikerTrackLog object containing the results of many, many iterations of the RandomHiker algorithm, and it selects from among the many VirtualHikerTrackLogs thus produced that most closely match the input criteria. Note that the "natural selection" process from among tracks that are produced with the randomization algorithm in RandomHiker makes this method both very compute intensive, and the results vary from run to run. It is a satisficing algorithm, not an optimizing one. It utilizes progressive back-off in an attempt to deliver a satisficing track with a slope between the idealSlope argument and a slope of 58% (About 30 degrees of slope, beyond which paths are barely traversable without ropes and mountaineering equipment, and beyond which "slope reduction" can be considered to have failed. Check the VirtualHikerTrackLog returned for its slopeVetted(), which will be set to true if this algorithm could find a track with a slope between idealSlope and 58%. Returns null if no such hike is possible.

Specified by:
getTrack in class AbstractHiker
Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike, returning null if no such hike possible
See Also:
overrideReasonableSlope(int)

getTrackPerpendicularConstraint

public VirtualHikerTrackLog getTrackPerpendicularConstraint()
Returns a VirtualHikerTrackLog object containing the results of many, many iterations of the RandomHiker algorithm, selecting from among the many VirtualHikerTrackLogs thus produced that most closely match the input criteria. Note that the "natural selection" process from among tracks that are produced with the randomization algorithm in RandomHiker makes this method both very compute intensive, and the results vary from run to run. It is a satisficing algorithm, not an optimizing one. It utilizes progressive back-off in an attempt to deliver a satisficing track with a slope between the idealSlope argument and a slope of 58% (About 30 degrees slope, beyond which paths are barely traversable without ropes and mountaineering equipment, and beyond which "slope reduction" can be considered to have failed. Check the VirtualHikerTrackLog returned for slopeVetted(), which will be set to true if this algorithm could find a track with a slope between idealSlope and 58%. The only difference between this method and getTrack() is that this method looks at both the slope between TrackPoints, as well as perpendicular slope. Returns null if no such hike is possible.

Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike, or null if none possible

overrideReasonableSlope

public VirtualHikerTrackLog overrideReasonableSlope(int override)
See the getTrack method. The only difference in this method is that the reasonable maximum slope of 58% can be overridden to a value higher or lower.

Parameters:
override - specify a higher reasonable slope
Returns:
a VirtualHikerTrackLog object containing the results of the artificial hike
See Also:
getTrack()

getUtmCoordinatePairElevArray

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