com.c5corp.c5Algorithms
Class VirtualHikerTrackLog

java.lang.Object
  extended by com.c5corp.c5gps.GpsType
      extended by com.c5corp.c5gps.GpsPointCollection
          extended by com.c5corp.c5gps.TrackLog
              extended by com.c5corp.c5Algorithms.VirtualHikerTrackLog
All Implemented Interfaces:
java.util.Enumeration

public class VirtualHikerTrackLog
extends TrackLog

The public class VirtualHikerTrackLog class extends com.c5corp.c5gps.TrackLog class. It encapsulates the results of a Simulated hiker.

VirtualHikerTrackLog adds methods to the TrackLog class, an accessor public boolean foundTarget() and a mutator setFoundTarget(boolean foundTarget). These allow the virtual hiker who produced the track log to indicate if it successfully reached the target. Not all virtual hikers can accomplish their hike, producing track logs that do not reach their targets. Particuarly unlikely to produce a completed (foundTarget() returns true) TrackLog is the getFiveDegreeTrack() method of the LcpHiker class, so you should always check that foundTarget() is true if you expect it to actually lead to the target location. Other methods useful to various virtual hikers are added here.

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

Field Summary
 
Fields inherited from class com.c5corp.c5gps.TrackLog
confs, trackPoints
 
Fields inherited from class com.c5corp.c5gps.GpsType
hdatum
 
Constructor Summary
VirtualHikerTrackLog(UtmCoordinatePairElev[][] table)
          default constructor
VirtualHikerTrackLog(java.util.Vector<TrackLog> trackLogs, UtmCoordinatePairElev[][] table)
          constructor taking a java.util.Vector of other TrackLog objects which will be appended together in the new TrackLog object.
 
Method Summary
 int calculateMaximumPerpendicularSlope()
          Calculates the maximum perpendicular slope (as a percentage) for the track by examining the cells perpendicular to the current direction of travel (to the subsequent point in the TrackLog.
 boolean foundTarget()
          Returns true if the virtual hiker producing this object was able to reach its target site.
 boolean perpendicularSlopeVetted()
          Returns true if the maximum perpendicular slope in this track log has been vetted by the producing algorithm.
protected  void setFoundTarget(boolean foundTarget)
          Method used by virtual hiker classes in this package to set the foundTarget to true or false.
protected  void setPerpendicularSlopeVetting(boolean perpendicularSlopeVettedByProducingAlgorithm)
          Method used by virtual hiker classes that vet perpendicular slope, setting to true or false depending on that algorithms vetting criteria.
protected  void setSlopeVetting(boolean slopeVettedByProducingAlgorithm)
          Method used by virtual hiker classes that vet slope, setting to true or false depending on that algorithms vetting criteria.
 boolean slopeVetted()
          Returns true if the maximum slope between TrackPoints this track log has been vetted by the producing algorithm.
 java.lang.String toString()
          override toString()
 
Methods inherited from class com.c5corp.c5gps.TrackLog
addTrackPoint, addTrackPoint, addTrackPoint, addTrackPoint, addTrackPoint, addTrackPoint, calculateCumulativeDistance, calculateCumulativeElevationChange, calculateDistance, calculateEastingRange, calculateElevationDifference, calculateElevationEfficencyRatio, calculateMaximumSlope, calculateMinMaxElevationDifference, calculateNorthingRange, calculateSWcornerEasting, calculateSWcornerNorthing, calculateTrackStdev, calculateTrackStraightnessRatio, countTrackPoints, equals, getCleanTrackName, getDatum, getDistance, getTrackName, getTrackPoints, getVersion, getZoneOffset, getZones, hasMoreElements, isRoundTrip, isSnapped, makeCopy, nextElement, removeDuplicateTrackPoints, reset, segmentTrackLog, setDatum, setIsSnapped, setTimeToGmt, setTrackName, setVersion, setZoneOffset, size, snapToDatabase, subSegment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualHikerTrackLog

public VirtualHikerTrackLog(UtmCoordinatePairElev[][] table)
default constructor

Parameters:
table - a UtmCoordinatePairElev[][] covering the same area as the TrackLog

VirtualHikerTrackLog

public VirtualHikerTrackLog(java.util.Vector<TrackLog> trackLogs,
                            UtmCoordinatePairElev[][] table)
constructor taking a java.util.Vector of other TrackLog objects which will be appended together in the new TrackLog object.

Parameters:
trackLogs - a Vector of TrackLog objects to append in a new TrackLog
table - a UtmCoordinatePairElev[][] covering the same area as the TrackLog
See Also:
TrackLog
Method Detail

foundTarget

public boolean foundTarget()
Returns true if the virtual hiker producing this object was able to reach its target site.

Returns:
boolean true if virtual hiker arrived at target site

setFoundTarget

protected void setFoundTarget(boolean foundTarget)
Method used by virtual hiker classes in this package to set the foundTarget to true or false.

Parameters:
foundTarget - Virtural hikers set to true or false depending on success in finding target

slopeVetted

public boolean slopeVetted()
Returns true if the maximum slope between TrackPoints this track log has been vetted by the producing algorithm. (Typically to ensure that some condition has been met.) Note that not all virtual hiking algorithms vet the slope.

Returns:
true if virtual hiker produced a hike meeting the algorithm's vetting criteria
See Also:
SlopeReductionHiker

setSlopeVetting

protected void setSlopeVetting(boolean slopeVettedByProducingAlgorithm)
Method used by virtual hiker classes that vet slope, setting to true or false depending on that algorithms vetting criteria.

Parameters:
slopeVettedByProducingAlgorithm - Virtural hikers set to true or false depending on success in finding a track with an appropriate slope.

perpendicularSlopeVetted

public boolean perpendicularSlopeVetted()
Returns true if the maximum perpendicular slope in this track log has been vetted by the producing algorithm. Note that not all virtual hiking algorithms vet the slope.

Returns:
true if virtual hiker produced a hike meeting the algorithm's perpendicular vetting criteria
See Also:
SlopeReductionHiker

setPerpendicularSlopeVetting

protected void setPerpendicularSlopeVetting(boolean perpendicularSlopeVettedByProducingAlgorithm)
Method used by virtual hiker classes that vet perpendicular slope, setting to true or false depending on that algorithms vetting criteria.

Parameters:
perpendicularSlopeVettedByProducingAlgorithm - Virtural hikers set to true or false depending on success in finding a track with an appropriate slope.

calculateMaximumPerpendicularSlope

public int calculateMaximumPerpendicularSlope()

Calculates the maximum perpendicular slope (as a percentage) for the track by examining the cells perpendicular to the current direction of travel (to the subsequent point in the TrackLog. Essentially, this gives the prevalant slope between the points to the right and left of the virtual hiker. It can be as useful in evaluating a "hikable" path as the examination of the slope between the points of a TrackLog. Returns a sentinel value of -1 if there are not at least two internal TrackPoints in the TrackLog.

It is also important to note that this method is only available in this subclass of TrackLog, because it is looking at data in the raster surrounding the points in the TrackLog, not the TrackLog itself.

Returns:
the maximum slope in the file.
See Also:
TrackPoint, C5UTMconfs

toString

public java.lang.String toString()

override toString()

Overrides:
toString in class TrackLog