more debug info

This commit is contained in:
Leijurv 2018-08-28 16:15:24 -07:00
parent 340b1558e4
commit 23cbef102d
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 9 additions and 1 deletions

View File

@ -75,6 +75,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
long timeoutTime = startTime + (slowPath ? Baritone.settings().slowPathTimeoutMS : Baritone.settings().pathTimeoutMS).<Long>get();
long lastPrintout = 0;
int numNodes = 0;
int numMovementsConsidered = 0;
int numEmptyChunk = 0;
boolean favoring = favoredPositions.isPresent();
int pathingMaxChunkBorderFetch = Baritone.settings().pathingMaxChunkBorderFetch.get(); // grab all settings beforehand so that changing settings during pathing doesn't cause a crash or unpredictable behavior
@ -125,6 +126,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
double actionCost = movementToGetToNeighbor.getCost(calcContext);
//long costEnd = System.nanoTime();
//System.out.println(movementToGetToNeighbor.getClass() + "" + (costEnd - costStart));
numMovementsConsidered++;
if (actionCost >= ActionCosts.COST_INF) {
continue;
}
@ -173,6 +175,9 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
currentlyRunning = null;
return Optional.empty();
}
System.out.println(numMovementsConsidered + " movements considered");
System.out.println("Open set size: " + ((BinaryHeapOpenSet) openSet).size());
System.out.println((int) (numNodes * 1.0 / ((System.currentTimeMillis() - startTime) / 1000F)) + " nodes per second");
double bestDist = 0;
for (int i = 0; i < bestSoFar.length; i++) {
if (bestSoFar[i] == null) {
@ -183,7 +188,6 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
bestDist = dist;
}
if (dist > MIN_DIST_PATH * MIN_DIST_PATH) { // square the comparison since distFromStartSq is squared
System.out.println((int) (numNodes * 1.0 / ((System.currentTimeMillis() - startTime) / 1000F)) + " nodes per second");
displayChatMessageRaw("Took " + (System.currentTimeMillis() - startTime) + "ms, A* cost coefficient " + COEFFICIENTS[i]);
if (COEFFICIENTS[i] >= 3) {
System.out.println("Warning: cost coefficient is greater than three! Probably means that");

View File

@ -52,6 +52,10 @@ public class BinaryHeapOpenSet implements IOpenSet {
this.array = new PathNode[size];
}
public int size() {
return size;
}
@Override
public final void insert(PathNode value) {
if (size >= array.length - 1) {