Go to the documentation of this file.
16 #include <unordered_map>
21 #define UINT32_MAX 4294967295U
89 static void SetLoc(
node *n,
double x,
double y,
double z)
98 static void GetLoc(
node *n,
double &x,
double &y,
double &z)
118 for (
unsigned int nodeID = 0; nodeID <= N; nodeID++)
121 if (nodeID == 0 || nodeID == 1)
131 double h = pow(2,nodeID-1) + 2*nodeID - 3;
142 double alpha = ((double)N - nodeID) * 1.5*
PI /(N - 1.0);
143 double beta = alpha - 0.5*
PI;
144 SetLoc(n,cos(beta),sin(beta),0);
149 double c = pow(2,N-1) + N - 2;
152 for (
unsigned int j = 1; j < N; j++)
154 for (
unsigned int i = j+1; i <= N; i++)
156 c = pow(2,i-2) + i - pow(2,j-1) - j;
183 for (
unsigned int i=1;i<=N-1;i++)
186 double h = 2*(N-1)*(N-1) - N - i + 2;
189 SetLoc(n, -1+(
double)(i-1)*2.0/((
double)N-2.0), 0.0, 0);
192 for (
unsigned int j=0; j<=N-2; j++)
199 SetLoc(n, -(
double)j/((
double)N-1.0), 0.9+((j%2)?0.1:0.0), 0);
210 for (
unsigned int i=1;i<=N-1;i++)
217 for (
unsigned int i=1; i<=N-1; i++)
219 double c = 2*(N-1)*(i-1) + 1;
225 for (
unsigned int i=N; i<=2*N-2; i++)
254 virtual const char*
GetName() {
return "MeroB"; }
270 void DrawText(
double x,
double y,
double z,
float r,
float g,
float b,
char* str);
271 void DrawEdge(
unsigned int from,
unsigned int to,
double weight);
void copy(double f, double g, graphState curr, graphState prev)
void SetLabelF(unsigned int index, double val) const
SearchNode(double _fCost=0, double _gCost=0, graphState curr=0, graphState prev=0)
bool operator()(const SearchNode &i1, const SearchNode &i2) const
virtual const char * GetName()
SearchNode(graphState curr)
void SetHeuristic(Heuristic< graphState > *heur)
bool DoSingleStepA(std::vector< graphState > &thePath)
static void SetLoc(node *n, double x, double y, double z)
std::vector< graphState > neighbors
uint64_t GetNodesExpanded()
uint64_t GetNodesReopened()
bool InitializeSearch(GraphEnvironment *env, Graph *g, graphState from, graphState to, std::vector< graphState > &thePath)
void DrawText(double x, double y, double z, float r, float g, float b, char *str)
std::unordered_map< graphState, MeroBUtil::SearchNode > NodeLookupTable
bool DoSingleStepB(std::vector< graphState > &thePath)
virtual double GetSolutionCost()
void SetVersion(unsigned int v)
bool fless(double a, double b)
OpenClosedList< MeroBUtil::SearchNode, MeroBUtil::SearchNodeHash, MeroBUtil::SearchNodeEqual, MeroBUtil::SearchNodeCompare > PQueue
bool DoSingleStepBP(std::vector< graphState > &thePath)
bool DoSingleSearchStep(std::vector< graphState > &thePath)
void DrawEdge(unsigned int from, unsigned int to, double weight)
static void GetLoc(node *n, double &x, double &y, double &z)
bool fgreater(double a, double b)
void GetPath(GraphEnvironment *env, Graph *_g, graphState from, graphState to, std::vector< graphState > &thePath)
MeroBUtil::NodeLookupTable closedList
MeroBUtil::PQueue openQueue
double GetLabelF(unsigned int index) const
void ExtractPathToStart(graphState goalNode, std::vector< graphState > &thePath)
OpenClosedList< MeroBUtil::SearchNode, MeroBUtil::SearchNodeHash, MeroBUtil::SearchNodeEqual, MeroBUtil::GGreater > GQueue
static Graph * genFig2(unsigned int N)
virtual int GetSolutionEdges()
size_t operator()(const SearchNode &x) const
bool operator()(const SearchNode &i1, const SearchNode &i2) const
uint64_t GetNodesTouched()
bool fequal(double a, double b, double tolerance=TOLERANCE)
Heuristic< graphState > * heuristic
Nodes to be stored within a Graph.
bool operator()(const SearchNode &i1, const SearchNode &i2) const
Edge class for connections between node in a Graph.
static Graph * genFig1(unsigned int N)