Package megamek.common.pathfinder
Class NewtonianAerospacePathFinder
java.lang.Object
megamek.common.pathfinder.NewtonianAerospacePathFinder
- Direct Known Subclasses:
AeroSpacePathFinder
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 Summary
FieldsModifier and TypeFieldDescriptionprotected List<MovePath.MoveStepType>
protected MovePath
protected Map<MovePathFinder.CoordsWithFacing,
Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 nodesgenerateStartingPaths
(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 pathsstatic NewtonianAerospacePathFinder
getInstance
(Game game) protected void
Worker method to put together a pre-defined array of possible movesprotected boolean
isIntermediatePath
(MovePath path) "Worker" function to determine whether the path being examined is an intermediate path.void
Computes paths to nodes in the graph.
-
Field Details
-
aerospacePaths
-
offBoardPath
-
visitedCoords
-
moves
-
-
Constructor Details
-
NewtonianAerospacePathFinder
-
-
Method Details
-
initializeMoveList
protected void initializeMoveList()Worker method to put together a pre-defined array of possible moves -
getAllComputedPathsUncategorized
-
run
Computes paths to nodes in the graph.- Parameters:
startingEdge
- the starting node. Should be empty.
-
getInstance
-
generateStartingPaths
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
"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
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.
-