public static class Robot.RobotUtility
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Robot.RobotUtility.FSPPredicate
FSPPredicate class: used internally in nearest path methods
|
| Constructor and Description |
|---|
Robot.RobotUtility() |
| Modifier and Type | Method and Description |
|---|---|
static Robot.GridCell |
findNearestAlly(Robot.GridCell origin,
Robot.GridCell[][] grid)
Find nearest neighbor:
Finds the nearest ally to cell, approximately as the crow flies. |
static Robot.GridCell[] |
findShortestPath(Robot.GridCell origin,
Robot.GridCell target,
Robot.GridCell[][] grid)
Shortest path calculator:
Finds the shortest path from one grid cell to another. This uses Dijkstra's algorithm to attempt to find the shortest path from one grid cell to another. |
public static Robot.GridCell findNearestAlly(Robot.GridCell origin, Robot.GridCell[][] grid)
origin - cell to findgrid - grid to analyzepublic static Robot.GridCell[] findShortestPath(Robot.GridCell origin, Robot.GridCell target, Robot.GridCell[][] grid)
origin - starting grid celltarget - ending grid cellgrid - grid to analyze