Classes | |
class | FSPPredicate |
Static Public Member Functions | |
static GridCell | findNearestAlly (GridCell origin, GridCell[][] grid) |
static GridCell[] | findShortestPath (GridCell origin, final GridCell target, GridCell[][] grid) |
Static Private Member Functions | |
static GridCell[] | findShortestPathInternal (GridCell origin, FSPPredicate isTarget, FSPPredicate isPassable, GridCell[][] grid) |
RobotUtility class
Provides utilities for students to use in Robot implementations.
Definition at line 125 of file Robot.java.
Find nearest neighbor:
Finds the nearest ally to cell, approximately as the crow flies.
origin | cell to find |
grid | grid to analyze |
Definition at line 139 of file Robot.java.
References Robot.RobotUtility.findShortestPathInternal().
|
static |
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. Cells are adjacent if they are up, down, left, or right of each other. Cells are not adjacent if they are diagonal to one another.
origin | starting grid cell |
target | ending grid cell |
grid | grid to analyze |
Definition at line 163 of file Robot.java.
References Robot.GridObject.EMPTY, and Robot.RobotUtility.findShortestPathInternal().
|
staticprivate |
Definition at line 180 of file Robot.java.
References Robot.RobotUtility.FSPPredicate.validCell().
Referenced by Robot.RobotUtility.findNearestAlly(), and Robot.RobotUtility.findShortestPath().