Go to the documentation of this file.
12 #ifndef CLUSTERABSTRACTION_H
13 #define CLUSTERABSTRACTION_H
19 #include <unordered_map>
42 typedef std::unordered_map<
edge*,
path*,
83 int center1Id,
int center2Id,
84 int row,
int col,
int length,
void computeClusterPaths(Graph *g)
void setCluster2Id(int id)
void addCluster(Cluster c)
bool operator()(const edge *e1, const edge *e2) const
int getClusterIdFromCoord(int row, int col) const
given a node's coordinates, find the cluster it's in
node * getLowLevelNode(node *abstract)
get the map-level node that is at the (x,y) coordinates of the abstract node
int nodeExists(const Cluster &c, double x, double y, Graph *g)
check if a node already exists in a certain cluster with a particular set of coordinates
Cluster abstraction for HPA* algorithm as described in (Botea,Mueller,Schaeffer 2004).
Cluster & getCluster(int id)
get the cluster from it's ID
void setUpParents(Graph *g)
Nodes are assigned the closest entrance node in the abstract Graph as their parent.
void createClustersAndEntrances()
create clusters on the abstract level and create corresponding entrances.
bool Pathable(node *start, node *goal)
Check if there is a path between two nodes.
void RemoveEdge(edge *, unsigned int)
std::vector< node * > & getParents()
MapAbstraction * Clone(Map *map)
Cluster(int id, int row, int col, int horizOrigin, int vertOrigin, int width, int height)
void linkEntrancesAndClusters()
from original HPA* abstiling.cpp
void AddNode(int)
Add an abstract node corresponding to an entrance to the cluster.
std::unordered_map< edge *, path *, clusterUtil::EdgeHash, clusterUtil::EdgeEqual > PathLookupTable
void createConnectivityGraph()
Add a 2nd level to the Graph.
Entrance(int center1Row, int center1Col, int cl1Id, int cl2Id, int center1Id, int center2Id, int row, int col, int length, Orientation orientation)
void connectedBFS(node *which, node *parent)
void createAbstractGraph()
std::vector< node * > parents
void buildNodeIntoParent(node *n, node *parent)
void addEntrance(Entrance e)
void createHorizEntrances(int, int, int, int, int)
based on the function from HPA* abswizard.cpp with the same name
void createVertEntrances(int, int, int, int, int)
based on the function from HPA* abstiling.cpp with the same name
virtual void OpenGLDraw() const
std::vector< path * > newPaths
size_t operator()(const edge *e) const
void abstractionBFS(node *which, node *parent, int cluster, int numOrigNodes, int numNodesAfter)
'borrowed' from MapSectorAbstraction.cpp
Orientation m_orientation
void setCluster1Id(int id)
void removeNodes(node *start, node *goal)
remove a start or goal node after the search has been completed.
std::vector< Entrance > entrances
int getClusterId(int row, int col) const
given a cluster row and column (NOT map row/column), return the cluster's ID.
ClusterAbstraction(Map *map, int _clusterSize)
create a cluster abstraction for the given map.
clusterUtil::PathLookupTable temp
void AddEdge(edge *, unsigned int)
const int MAX_ENTRANCE_WIDTH
int getIthNodeNum(int i) const
void printPathAsCoord(path *p)
clusterUtil::PathLookupTable paths
int getClusterIdFromNode(node *n)
Given a map node, return the ID of the cluster it's in.
path * getCachedPath(edge *e)
get the map-level path that corresponds to abstract edge e
A linked list of nodes which form a continuous path.
void printMapCoord(node *n)
node * insertNode(node *n, int &expanded, int &touched)
insert a start or goal node in to the abstract Graph (for searching purposes).
void addAbsNodes(Graph *g)
Add a node for cluster for each entrance.
std::vector< Cluster > clusters
Nodes to be stored within a Graph.
A tile-based representation of the world.
Edge class for connections between node in a Graph.