HOG2
RoadMap.h
Go to the documentation of this file.
1 //
2 // RoadMap.h
3 // hog2 glut
4 //
5 // Created by Nathan Sturtevant on 8/25/17.
6 // Copyright © 2017 University of Denver. All rights reserved.
7 //
8 
9 #ifndef RoadMap_h
10 #define RoadMap_h
11 
12 #include <stdio.h>
13 #include "SearchEnvironment.h"
14 #include "GraphEnvironment.h"
15 
18 
19 class RoadMap : public SearchEnvironment<intersection, neighbor> {
20 public:
21  RoadMap(const char *graph, const char *coordinates, bool time);
22  virtual ~RoadMap();
23  virtual void GetSuccessors(const intersection &nodeID, std::vector<intersection> &neighbors) const;
24  virtual void GetActions(const intersection &nodeID, std::vector<neighbor> &actions) const;
25  Graph *GetGraph() { return g; }
26  virtual neighbor GetAction(const intersection &s1, const intersection &s2) const;
27  virtual void ApplyAction(intersection &s, neighbor a) const;
28 
29  virtual bool InvertAction(neighbor &a) const;
30 
32  virtual double HCost(const intersection &node1, const intersection &node2) const;
33  virtual double GCost(const intersection &node1, const intersection &node2) const;
34  virtual double GCost(const intersection &node, const neighbor &act) const;
35  virtual bool GoalTest(const intersection &node, const intersection &goal) const;
36 
37  virtual uint64_t GetMaxHash() const;
38  virtual uint64_t GetStateHash(const intersection &node) const;
39  virtual void GetStateFromHash(uint64_t parent, intersection &s) const;
40 
41  virtual uint64_t GetActionHash(neighbor act) const;
42  std::string GetName() { return std::string("RoadMap"); }
43  virtual void SetColor(GLfloat rr, GLfloat g, GLfloat b, GLfloat t = 1.0) const;
44  virtual void GetColor(GLfloat& rr, GLfloat& g, GLfloat& b, GLfloat &t) const;
45  virtual void OpenGLDraw() const;
46  virtual void OpenGLDraw(const intersection&) const;
47  virtual void OpenGLDraw(const intersection&, const neighbor&) const;
48  virtual void GLDrawPath(const std::vector<intersection> &x) const;
49 protected:
51  Graph *g;
52  double maxSpeed;
53  double scale;
54 };
55 
56 
57 #endif /* RoadMap_h */
RoadMap::maxSpeed
double maxSpeed
Definition: RoadMap.h:52
graphMove
Definition: GraphEnvironment.h:34
graphState
unsigned long graphState
Definition: GraphEnvironment.h:32
RoadMap::GetActionHash
virtual uint64_t GetActionHash(neighbor act) const
Definition: RoadMap.cpp:270
RoadMap::GLDrawPath
virtual void GLDrawPath(const std::vector< intersection > &x) const
Definition: RoadMap.cpp:291
RoadMap::GetSuccessors
virtual void GetSuccessors(const intersection &nodeID, std::vector< intersection > &neighbors) const
Definition: RoadMap.cpp:197
RoadMap::scale
double scale
Definition: RoadMap.h:53
neighbor
graphMove neighbor
Definition: RoadMap.h:17
RoadMap::GCost
virtual double GCost(const intersection &node1, const intersection &node2) const
Definition: RoadMap.cpp:239
RoadMap::GetName
std::string GetName()
Definition: RoadMap.h:42
Graph
A generic Graph class.
Definition: Graph.h:66
RoadMap::GetGraph
Graph * GetGraph()
Definition: RoadMap.h:25
RoadMap::GoalTest
virtual bool GoalTest(const intersection &node, const intersection &goal) const
Definition: RoadMap.cpp:249
RoadMap::HCost
virtual double HCost(const intersection &node1, const intersection &node2) const
Heuristic value between two arbitrary nodes.
Definition: RoadMap.cpp:226
RoadMap::ApplyAction
virtual void ApplyAction(intersection &s, neighbor a) const
Definition: RoadMap.cpp:213
RoadMap::GetAction
virtual neighbor GetAction(const intersection &s1, const intersection &s2) const
Definition: RoadMap.cpp:208
RoadMap::SetColor
virtual void SetColor(GLfloat rr, GLfloat g, GLfloat b, GLfloat t=1.0) const
Definition: RoadMap.cpp:296
RoadMap
Definition: RoadMap.h:19
RoadMap::GetStateFromHash
virtual void GetStateFromHash(uint64_t parent, intersection &s) const
Definition: RoadMap.cpp:265
RoadMap::~RoadMap
virtual ~RoadMap()
Definition: RoadMap.cpp:191
intersection
graphState intersection
Definition: RoadMap.h:16
RoadMap::OpenGLDraw
virtual void OpenGLDraw() const
Definition: RoadMap.cpp:276
RoadMap::ge
GraphEnvironment * ge
Definition: RoadMap.h:50
SearchEnvironment< intersection, neighbor >::GetColor
virtual rgbColor GetColor() const
Definition: SearchEnvironment.h:105
RoadMap::GetMaxHash
virtual uint64_t GetMaxHash() const
Definition: RoadMap.cpp:255
RoadMap::GetStateHash
virtual uint64_t GetStateHash(const intersection &node) const
Definition: RoadMap.cpp:260
RoadMap::InvertAction
virtual bool InvertAction(neighbor &a) const
Definition: RoadMap.cpp:219
RoadMap::g
Graph * g
Definition: RoadMap.h:51
RoadMap::GetActions
virtual void GetActions(const intersection &nodeID, std::vector< neighbor > &actions) const
Definition: RoadMap.cpp:202
SearchEnvironment
Definition: SearchEnvironment.h:30
GraphEnvironment
Definition: GraphEnvironment.h:291
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
SearchEnvironment.h
RoadMap::RoadMap
RoadMap(const char *graph, const char *coordinates, bool time)
Definition: RoadMap.cpp:14
GraphEnvironment.h