Package net.citizensnpcs.api.astar
Class AStarMachine<N extends AStarNode,P extends Plan> 
java.lang.Object
net.citizensnpcs.api.astar.AStarMachine<N,P> 
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionstatic <N extends AStarNode,P extends Plan> 
 AStarMachine<N, P> Creates an AStarMachine usingSimpleAStarStorageas the storage backend.static <N extends AStarNode,P extends Plan> 
 AStarMachine<N, P> createWithStorage(Supplier<AStarStorage> storageSupplier) Creates an AStarMachine that uses the givenAStarStorageinstances.getStateFor(AStarGoal<N> goal, N start) Creates anAStarMachine<N extends AStarNode,that can be reused across multiple invocations of {P extends Plan>.AStarState run(AStarState, int).run(AStarMachine<N, P>.AStarState state) Runs theAStarMachine<N extends AStarNode,until a plan is found.P extends Plan>.AStarState run(AStarMachine<N, P>.AStarState state, int maxIterations) Runs the machine using the givenAStarMachine<N extends AStarNode,'sP extends Plan>.AStarState AStarStorage.Runs the machine until a plan is either found or cannot be generated.Runs the machine fully until the iteration limit has been exceeded.voidsetStorageSupplier(Supplier<AStarStorage> newSupplier) Sets theSupplierto use to generate instances ofAStarStoragefor use while searching.
- 
Method Details- 
getStateForCreates anAStarMachine<N extends AStarNode,that can be reused across multiple invocations of {P extends Plan>.AStarState run(AStarState, int).
- 
runRuns theAStarMachine<N extends AStarNode,until a plan is found.P extends Plan>.AStarState - Parameters:
- state- The state to use
- Returns:
- The generated Plan, ornull
- See Also:
 
- 
runRuns the machine using the givenAStarMachine<N extends AStarNode,'sP extends Plan>.AStarState AStarStorage. Can be used to provide a continuation style usage of the A* algorithm.- Parameters:
- state- The state to use
- maxIterations- The maximum number of iterations
- Returns:
- The generated Plan, ornullif not found
 
- 
runFullyRuns the machine until a plan is either found or cannot be generated.- See Also:
 
- 
runFullyRuns the machine fully until the iteration limit has been exceeded. This will use the supplied goal and start to generate neighbours until the goal state has been reached using the A* algorithm.
- 
setStorageSupplierSets theSupplierto use to generate instances ofAStarStoragefor use while searching.- Parameters:
- newSupplier- The new supplier to use
 
- 
createWithDefaultStorageCreates an AStarMachine usingSimpleAStarStorageas the storage backend.- Returns:
- The created instance
 
- 
createWithStoragepublic static <N extends AStarNode,P extends Plan> AStarMachine<N,P> createWithStorage(Supplier<AStarStorage> storageSupplier) Creates an AStarMachine that uses the givenAStarStorageinstances.- Parameters:
- storageSupplier- The storage supplier
- Returns:
- The created instance
 
 
-