Package me.wobblyyyy.pathfinder.finders
Class SpeedFinder
java.lang.Object
me.wobblyyyy.pathfinder.finders.SpeedFinder
- All Implemented Interfaces:
Generator
public class SpeedFinder extends java.lang.Object implements Generator
A relatively quick path generator - think of it as an extended version of
the LightningFinder.
This finder checks for any zones within the given pathfinding area, and, if it doesn't find any, just generates a path. However, if it DOES find more than one solid zone in the given area, it'll double-check to ensure that the robot can't possibly collide with any of the objects on its path.
- Since:
- 0.1.0
- Author:
- Colin Robertson
-
Field Summary
Fields Modifier and Type Field Description private PathfinderConfig
config
The pathfinder's configuration.private double
rR
Robot radius.private double
rX
Robot X.private double
rY
Robot Y. -
Constructor Summary
Constructors Constructor Description SpeedFinder(PathfinderConfig config)
Create a new SpeedFinder. -
Method Summary
Modifier and Type Method Description me.wobblyyyy.edt.DynamicArray<Point>
getCoordinatePath(Point start, Point end)
Get a newly-generated coordinate path between two points.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
rX
private final double rXRobot X. -
rY
private final double rYRobot Y. -
rR
private final double rRRobot radius. -
config
The pathfinder's configuration.
-
-
Constructor Details
-
SpeedFinder
Create a new SpeedFinder.- Parameters:
config
- the Pathfinder library's configuration.
-
-
Method Details
-
getCoordinatePath
Get a newly-generated coordinate path between two points.This path is INCREDIBLY linear - it's quite literally just two points. If this method of pathfinding doesn't end up working, we can instead use the ThetaStar pathfinder, which, unless there's not a single path available, will generate a valid path.
- Specified by:
getCoordinatePath
in interfaceGenerator
- Parameters:
start
- the start coordinate.end
- the end coordinate.- Returns:
- either no or two points for a path.
-