public class TSPSearchPlanner extends TrackedSearchPlanner implements Runnable
Modifier and Type | Field and Description |
---|---|
protected static double |
COS60 |
protected double[][] |
searchSequence |
protected static double |
SIN60 |
static double |
SIXTY_DEGREES |
static double |
THIRTY_DEGREES |
pd, sweepWidth, trackSpacing
plan, searchArea, startPoint
Constructor and Description |
---|
TSPSearchPlanner(GeoArea searchArea,
double S,
double PD,
double[] startPosit)
Creates a new instance of TSPSearchPlanner
|
TSPSearchPlanner(GeoArea searchArea,
double S,
double PD,
double[] startPosit,
boolean pointFocus)
Creates a new instance of TSPSearchPlanner
|
Modifier and Type | Method and Description |
---|---|
protected List<double[]> |
computeVisitPoints()
Computes a set of points that blanket the search area.
|
double |
distance()
Computes the total distance covered by the path
|
protected SearchPlan |
generatePlan()
Converts the sequenced array of transit points into a plan
|
protected void |
incrementallyImprove()
Uses pairwise comparison of array elements to incrementally
improve a proposed traveling salesman problem solution.
|
double |
partialDistance(int endPt)
Computes the distance from the start to a specified point using the path
|
double |
partialDistance(int startPt,
int endPt)
Computes the distance from a specified start point to a specified end point on the path
|
double |
remainingDistance(int startPt)
Computes the distance remaining from the specified point to the end of the path
|
void |
run()
Implements the Runnable interface
|
setRequiredPD, setSweepWidth, setTrackSpacing
getPlan, getRunTime, setRunTime
public static final double THIRTY_DEGREES
public static final double SIXTY_DEGREES
protected static final double SIN60
protected static final double COS60
protected double[][] searchSequence
public TSPSearchPlanner(GeoArea searchArea, double S, double PD, double[] startPosit, boolean pointFocus)
searchArea
- geographic area that is to be searchedS
- PD
- startPosit
- double[2] defining the vehicle's position at the beginning of the searchpointFocus
- set to true if the vehicle is to start the search at the region's centerpublic TSPSearchPlanner(GeoArea searchArea, double S, double PD, double[] startPosit)
searchArea
- geographic area that is to be searchedS
- PD
- startPosit
- double[2] defining the vehicle's position at the beginning of the searchprotected SearchPlan generatePlan()
SearchPlan
protected final List<double[]> computeVisitPoints()
public double partialDistance(int endPt)
endPt
- of the last point in the partial transitpublic double partialDistance(int startPt, int endPt)
startPt
- index of the first point in the partial transitendPt
- index of the last point in the partial transitpublic double remainingDistance(int startPt)
startPt
- of the last point in the partial transitpublic double distance()
protected void incrementallyImprove()
public void run()
run
in interface Runnable
run
in class TrackedSearchPlanner