HOG2
RadiusAbstraction.h
Go to the documentation of this file.
1 /*
2  * $Id: RadiusAbstraction.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 6/3/05.
6  * Modified by Nathan Sturtevant on 02/29/20.
7  *
8  * This file is part of HOG2. See https://github.com/nathansttt/hog2 for licensing information.
9  *
10  */
11 
12 #include "MapAbstraction.h"
13 
14 #ifndef RADIUSABSTRACTION_H
15 #define RADIUSABSTRACTION_H
16 
17 class RadiusAbstraction : public MapAbstraction {
18 public:
19  RadiusAbstraction(Map *, int);
21  MapAbstraction *Clone(Map *_m) { return new RadiusAbstraction(_m, radius); }
22 
23  virtual bool Pathable(node *from, node *to);
24 
25  // utility functions
27  virtual void VerifyHierarchy();
28 
29  // hierarchical modifications
31  virtual void RemoveNode(node *n);
33  virtual void RemoveEdge(edge *e, unsigned int absLevel);
35  virtual void AddNode(node *n);
37  virtual void AddEdge(edge *e, unsigned int absLevel);
40  virtual void RepairAbstraction();
41 private:
42  void buildAbstraction();
43  void buildNodeIntoParent(node *n, node *parent);
44  void abstractionBFS(node *which, node *parent, int depth);
45 
46  void addEdges(Graph *g);
47  void addNodes(Graph *g);
48 
49  int radius;
50 };
51 
52 #endif
RadiusAbstraction::~RadiusAbstraction
~RadiusAbstraction()
Definition: RadiusAbstraction.cpp:25
RadiusAbstraction::addEdges
void addEdges(Graph *g)
Definition: RadiusAbstraction.cpp:122
RadiusAbstraction
Definition: RadiusAbstraction.h:17
RadiusAbstraction::RemoveNode
virtual void RemoveNode(node *n)
remove node from abstraction
Definition: RadiusAbstraction.cpp:55
Graph
A generic Graph class.
Definition: Graph.h:66
RadiusAbstraction::AddNode
virtual void AddNode(node *n)
add node to abstraction
Definition: RadiusAbstraction.cpp:65
RadiusAbstraction::buildNodeIntoParent
void buildNodeIntoParent(node *n, node *parent)
Definition: RadiusAbstraction.cpp:157
RadiusAbstraction::Pathable
virtual bool Pathable(node *from, node *to)
Definition: RadiusAbstraction.cpp:29
RadiusAbstraction::addNodes
void addNodes(Graph *g)
Definition: RadiusAbstraction.cpp:97
RadiusAbstraction::Clone
MapAbstraction * Clone(Map *_m)
Definition: RadiusAbstraction.h:21
MapAbstraction.h
RadiusAbstraction::buildAbstraction
void buildAbstraction()
Definition: RadiusAbstraction.cpp:84
RadiusAbstraction::VerifyHierarchy
virtual void VerifyHierarchy()
verify that the hierarchy is consistent
Definition: RadiusAbstraction.cpp:49
RadiusAbstraction::abstractionBFS
void abstractionBFS(node *which, node *parent, int depth)
Definition: RadiusAbstraction.cpp:143
RadiusAbstraction::radius
int radius
Definition: RadiusAbstraction.h:49
RadiusAbstraction::RemoveEdge
virtual void RemoveEdge(edge *e, unsigned int absLevel)
remove edge from abstraction
Definition: RadiusAbstraction.cpp:60
RadiusAbstraction::RadiusAbstraction
RadiusAbstraction(Map *, int)
Definition: RadiusAbstraction.cpp:17
RadiusAbstraction::RepairAbstraction
virtual void RepairAbstraction()
This must be called after any of the above add/remove operations.
Definition: RadiusAbstraction.cpp:80
RadiusAbstraction::AddEdge
virtual void AddEdge(edge *e, unsigned int absLevel)
add edge to abstraction
Definition: RadiusAbstraction.cpp:72
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
Map
A tile-based representation of the world.
Definition: Map.h:142
edge
Edge class for connections between node in a Graph.
Definition: Graph.h:129