Class RandomPathFinder

  • All Implemented Interfaces:
    PathFinder

    public class RandomPathFinder
    extends java.lang.Object
    implements PathFinder
    PathFinder that takes a map and a dummy set of range readings. It finds a path that is in short moves, has no obstacles in the way and where valid range readings can be taken from each waypoint. The algorithm is not deterministic so each time it is called a new route will be found.
    Author:
    Lawrie Griffiths
    • Method Detail

      • setMaxRange

        public void setMaxRange​(float range)
        Set the maximum valid range readings
        Parameters:
        range - the maximum range
      • setMaxDistance

        public void setMaxDistance​(float distance)
        Set the maximum distance between waypoints
        Parameters:
        distance - the maximum distance
      • setMaxIterations

        public void setMaxIterations​(int iterations)
        Set the maximum number of iterations before giving up when searching for a path
        Parameters:
        iterations - the maximum number of iterations
      • setClearance

        public void setClearance​(float clearance)
        Set the clearance around the edge of the map. This does not really work as clearance shiould be around all walls and obstacles.
        Parameters:
        clearance - the clearance