public class MinPathFinder
extends java.lang.Object
Constructor and Description |
---|
MinPathFinder(double[][] dists,
boolean allowHorizontal)
This sets up a path finder to find the min path from last row to the first row given the cost
of being at each position.
|
Modifier and Type | Method and Description |
---|---|
TwoDLoc |
bestSourceLoc()
This returns the loc of the best source column.
|
double |
costOf(int row,
int col) |
TwoDLoc |
follow(TwoDLoc currentLoc)
Given a row and column number, this says where to go next to head toward the destination.
|
double[][] |
getCosts() |
TwoDLoc[][] |
getPaths() |
public MinPathFinder(double[][] dists, boolean allowHorizontal)
dists
- This gives the cost of each position where dists[0] is the row of
destination locations and dists[dists.length-1] is the row of starting
positions. This must be a rectangular array of non-zero dimensions.allowHorizontal
- This says whether or not to allow the path to follow along a row if it
wants to.public TwoDLoc follow(TwoDLoc currentLoc)
public TwoDLoc bestSourceLoc()
public double costOf(int row, int col)
public TwoDLoc[][] getPaths()
public double[][] getCosts()