|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Navigation
Navigation is an interface that gathers methods for agent's navigation through a map. Therefore there are methods to run along some path, to obtain nearest health item, navigation point and run for them
Method Summary | |
---|---|
java.util.ArrayList<NavPoint> |
getNavPointsAStar(AStarResult result)
auxiliary A* method converts AStarResult to ArrayList of NavPoints which is then used as path in runAlongItemsInTheMap |
AStarResult |
getPathAStar(NavPoint toWhat)
Returns path from your current position to the 'toWhat' or null if path doesn't exist. |
AStarResult |
getPathAStar(NavPoint toWhat,
int maxNumOfIterations)
Returns path from your current position to the 'toWhat' or null if path doesn't exist. |
java.util.ArrayList<NavPoint> |
getPathOfID(int ID)
Method for obtaining the path returned by GB due to the GETPATH request sent through sendGetPath(navPoint, pathID). |
java.util.ArrayList<Item> |
nearestHealth(int strength,
int numberOfHealths)
very basic method for getting healths of strenght greater or equal to strenght numberOfHealths specifies how many do you want for more complex and more efficient way of doing this use something else think about map preprocessing and more efficient methods of search through the space (than using AStar numerous times) note, it uses restricted AStar - restricted number of iterations, so it can find nothing! |
java.util.ArrayList<Item> |
nearestItems(MessageType type,
int numberOfItems)
very basic method for getting restricted number of closest items of specified type for more complex and more efficient way of doing this use something else think about map preprocessing and more efficient methods of search through the space (than using AStar numerous times) note, it uses restricted AStar - restricted number of iterations, so it can find nothing! |
NavPoint |
nearestNavPoint(Triple from)
Finds nearest navPoint - presume that the agent doesn't see any, so it uses this unefficient method needs Triple from as a parameter |
NavPoint |
nearestNavPoint(Triple from,
int minDistance)
Finds nearest navPoint - presume that the agent doesn't see any, so it uses this unefficient method counts only those in bigger distance than specified needs Triple from as a parameter |
boolean |
runAlongPath()
method to follow smoothly desired path - list of navigation points obtained from game map can handle movers - wait on it until top and leave note that movers in the way are in this fashion: - LiftExit -> LiftCenter -> LiftExit so as agent is supposed to go up when he is supposed to go to LiftCenter (therefore is around first LiftExit) he waits for mover to be about his level and then goes on it, wait to level with second LiftExit and move on |
void |
runAroundItemsInTheMap(java.util.List<? extends Item> itemsToRunAround,
boolean AStar)
run around items in the map is a complex method which covers behavior which runs around the map according to specified list of items, it works in the following fashion: 1) nextItem == null => shuffle itemsToRunAround, choose first one 2) path == null => obtain path 3) run along the path 4) if the run along fails or if bot reaches the item, switch to next on |
boolean |
safeRunToLocation(Triple location)
safely navigates agent to the location of choosen item (could be anywhere). moreover you can set the distance at which agent will stop when reaching last point of the path (by setting GameMapSettings.lastNavigationPointOfPathPrecision) it should be I think at least 5 as I think it is not guaranteed that bots moves precisely. |
void |
sendGetPathToLocation(int ID,
Triple toWhat)
This method sends GETPATH query to GameBots - you have to provide PathID under which the path will be returned by GB and stored in GameMap instance. |
void |
sendGetPathToNavPoint(NavPoint toWhat)
This method sends GETPATH query to GameBots - you have to provide PathID under which the path will be returned by GB and stored in GameMap instance. |
Method Detail |
---|
java.util.ArrayList<Item> nearestHealth(int strength, int numberOfHealths)
for more complex and more efficient way of doing this use something else think about map preprocessing and more efficient methods of search through the space (than using AStar numerous times)
note, it uses restricted AStar - restricted number of iterations, so it can find nothing!
java.util.ArrayList<Item> nearestItems(MessageType type, int numberOfItems)
for more complex and more efficient way of doing this use something else think about map preprocessing and more efficient methods of search through the space (than using AStar numerous times)
note, it uses restricted AStar - restricted number of iterations, so it can find nothing!
NavPoint nearestNavPoint(Triple from)
needs Triple from as a parameter
from
- - most often agent location
NavPoint nearestNavPoint(Triple from, int minDistance)
counts only those in bigger distance than specified
needs Triple from as a parameter
from
- - usualy agent location
void sendGetPathToNavPoint(NavPoint toWhat)
toWhat
- - target (NavPoint) of the requestvoid sendGetPathToLocation(int ID, Triple toWhat)
ID
- - id which is ment to be returned with query, toWhat -
location (triple)java.util.ArrayList<NavPoint> getPathOfID(int ID)
ID
-
AStarResult getPathAStar(NavPoint toWhat, int maxNumOfIterations)
java.util.ArrayList<NavPoint> getNavPointsAStar(AStarResult result)
result
- - AStarResult
AStarResult getPathAStar(NavPoint toWhat)
boolean runAlongPath()
void runAroundItemsInTheMap(java.util.List<? extends Item> itemsToRunAround, boolean AStar)
itemsToRunAround
- - array of items - like all weapons in the mapAStar
- - switch = to use or not to use built-in AStar - both work
about the sameboolean safeRunToLocation(Triple location)
location
- - location to run to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |