Package cl.cromer.azaraka.ai
Class PlayerBreadthFirstAI
- java.lang.Object
-
- cl.cromer.azaraka.ai.AI
-
- cl.cromer.azaraka.ai.PlayerBreadthFirstAI
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cl.cromer.azaraka.Constants
Constants.AIHeuristic, Constants.LogLevel, Constants.PlayerAIType
-
-
Field Summary
-
Fields inherited from interface cl.cromer.azaraka.Constants
AI_HEURISTIC, APPEND_LOGS, CELL_PIXELS, CHESTS, ENEMIES, ENEMY_AI, EXPORT_SCENE, FONT, FONT_SIZE, GENERATE_SCENE, GLOBAL_LOG, HORIZONTAL_CELLS, LOG_TO_FILE, OBSTACLES, PLAYER_AI, PRETTY_JSON, TITLE, VERTICAL_CELLS, VOLUME
-
-
Constructor Summary
Constructors Constructor Description PlayerBreadthFirstAI(Scene scene, Player player)
Initialize the algorithm
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDestination(State destination)
Add a destination to the AIvoid
removeKeyDestination(int x, int y)
Remove the picked up key from destinations if it is therevoid
run()
Run the steps in a loopboolean
search(State searchInitial, State searchGoal)
Find a path to the goalvoid
sortDestinations()
Sort the destinations by importance, if the importance is the same then sort them by distance-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cl.cromer.azaraka.Constants
getLogger, initializeLogger, random
-
Methods inherited from interface cl.cromer.azaraka.ai.PlayerAI
checkCondition, destinationArrived, doAction, getOpenSpaceAroundPlayer, heuristic, sortDestinations
-
-
-
-
Method Detail
-
addDestination
public void addDestination(State destination)
Add a destination to the AI- Specified by:
addDestination
in interfacePlayerAI
- Overrides:
addDestination
in classAI
- Parameters:
destination
- The state containing the destination
-
removeKeyDestination
public void removeKeyDestination(int x, int y)
Remove the picked up key from destinations if it is there- Overrides:
removeKeyDestination
in classAI
- Parameters:
x
- The x coordinate of the keyy
- The y coordinate of the key
-
sortDestinations
public void sortDestinations()
Sort the destinations by importance, if the importance is the same then sort them by distance- Specified by:
sortDestinations
in interfacePlayerAI
-
-