Class NewtonianAerospacePathFinder

java.lang.Object
megamek.common.pathfinder.NewtonianAerospacePathFinder
Direct Known Subclasses:
AeroSpacePathFinder

public class NewtonianAerospacePathFinder extends Object
This set of classes is intended to be used by AI players to generate paths for infantry units. This includes both foot and jump paths.
  • Field Details

  • Constructor Details

    • NewtonianAerospacePathFinder

      protected NewtonianAerospacePathFinder(Game game)
  • Method Details

    • initializeMoveList

      protected void initializeMoveList()
      Worker method to put together a pre-defined array of possible moves
    • getAllComputedPathsUncategorized

      public Collection<MovePath> getAllComputedPathsUncategorized()
    • run

      public void run(MovePath startingEdge)
      Computes paths to nodes in the graph.
      Parameters:
      startingEdge - the starting node. Should be empty.
    • getInstance

      public static NewtonianAerospacePathFinder getInstance(Game game)
    • generateStartingPaths

      protected List<MovePath> generateStartingPaths(MovePath startingEdge)
      Generates a list of possible step combinations that should be done at the beginning of a path Has side effect of updating the visited coordinates map and adding it to the list of generated paths
      Returns:
      List of all possible "starting" paths
    • isIntermediatePath

      protected boolean isIntermediatePath(MovePath path)
      "Worker" function to determine whether the path being examined is an intermediate path. This means that the path, as is, is not a valid path, but its children may be. This mainly applies to aero paths that have not used all their velocity. For newtonian space flight, it is never an intermediate path.
      Parameters:
      path - The move path to consider.
      Returns:
      Whether it is an intermediate path or not.
    • discardPath

      protected boolean discardPath(MovePath path, MovePathFinder.CoordsWithFacing pathDestination)
      Worker function to determine whether we should discard the current path (due to it being illegal or redundant) or keep generating child nodes
      Parameters:
      path - The move path to consider
      Returns:
      Whether to keep or dicsard.