Go to the documentation of this file.
19 #include <unordered_map>
24 #define UINT32_MAX 4294967295U
33 #define PROP_DP 7 // 6 is AStarDelay
38 #define PROP_DPDLMX 11 // DP + Delay + MX
183 for (
unsigned int nodeID = 0; nodeID <= N; nodeID++)
186 if (nodeID == 0 || nodeID == 1)
191 double h = pow(2,nodeID-1) + 2*nodeID - 3;
202 double alpha = ((double)N - nodeID) * 1.5*
PI /(N - 1.0);
203 double beta = alpha - 0.5*
PI;
204 SetLoc(n,cos(beta),sin(beta),0);
209 double c = pow(2,N-1) + N - 2;
212 for (
unsigned int j = 1; j < N; j++)
214 for (
unsigned int i = j+1; i <= N; i++)
216 c = pow(2,i-2) + i - pow(2,j-1) - j;
238 for (
unsigned int nodeID = 0; nodeID <= N; nodeID++)
241 if (nodeID == 0 || nodeID == 1 || nodeID==N)
246 double h = pow(2,nodeID-1) + 2*nodeID - 3;
257 double alpha = ((double)N - nodeID) * 1.5*
PI /(N - 1.0);
258 double beta = alpha - 0.5*
PI;
259 SetLoc(n,cos(beta),sin(beta),0);
264 double c = pow(2,N-1) + N - 2;
267 for (
unsigned int j = 1; j < N; j++)
269 for (
unsigned int i = j+1; i <= N; i++)
271 c = pow(2,i-2) + i - pow(2,j-1) - j;
298 for (
unsigned int i=1;i<=N-1;i++)
301 double h = 2*(N-1)*(N-1) - N - i + 2;
304 SetLoc(n, -1+(
double)(i-1)*2.0/((
double)N-2.0), 0.0, 0);
307 for (
unsigned int j=0; j<=N-2; j++)
313 SetLoc(n, -(
double)j/((
double)N-1.0), 0.9+((j%2)?0.1:0.0), 0);
324 for (
unsigned int i=1;i<=N-1;i++)
331 for (
unsigned int i=1; i<=N-1; i++)
333 double c = 2*(N-1)*(i-1) + 1;
339 for (
unsigned int i=N; i<=2*N-2; i++)
367 for (
unsigned int i=1;i<=N-1;i++)
373 SetLoc(n, -1+(
double)(i-1)*2.0/((
double)N-2.0), 0.0, 0);
376 for (
unsigned int j=0; j<=N+1; j++)
382 SetLoc(n, -(
double)j/((
double)N-1.0), 0.9+((j%2)?0.1:0.0), 0);
393 for (
unsigned int i=1;i<=N-1;i++)
400 for (
unsigned int i=1; i<=N-1; i++)
408 for (
unsigned int i=N; i<=2*N-1; i++)
443 Prop(
unsigned int v,
double del) {
493 void DrawText(
double x,
double y,
double z,
float r,
float g,
float b,
char* str);
494 void DrawEdge(
unsigned int from,
unsigned int to,
double weight);
568 void Broadcast(
int level,
int levelcount);
static void SetLoc(node *n, double x, double y, double z)
bool DoSingleStepBFS(std::vector< graphState > &thePath)
void SetLabelF(unsigned int index, double val) const
void RelaxDelayNode(double f, double g, graphState neighbor, PropUtil::SearchNode &neighborNode, graphState topNodeID)
bool DoSingleStepBP(std::vector< graphState > &thePath)
void DrawText(double x, double y, double z, float r, float g, float b, char *str)
SearchNode(double _fCost=0, double _gCost=0, graphState curr=UINT32_MAX, graphState prev=UINT32_MAX)
void ReversePropX2(PropUtil::SearchNode &topNode)
OpenListB< PropUtil::SearchNode, PropUtil::SearchNodeHash, PropUtil::SearchNodeEqual, PropUtil::GGreater, PropUtil::GGreater, PropUtil::FExtract > GQueue
void DrawEdge(unsigned int from, unsigned int to, double weight)
static Graph * genFig4(unsigned int N)
void ReversePropX1(PropUtil::SearchNode &topNode)
uint64_t GetNodesTouched()
bool DoSingleStepDPDLMX(std::vector< graphState > &thePath)
uint64_t GetNodesReopened()
uint64_t GetNodesMetaExpanded()
void GetLowestG(PropUtil::SearchNode &gNode)
void GetLowestGF(PropUtil::SearchNode &gNode)
static Graph * genFig2(unsigned int N)
PropUtil::PQueue openQueue
void ComputeNewHMero3a(double &h, double &h_tmp, graphState neighbor, PropUtil::SearchNode &neighborNode, double altH, int mode)
std::vector< graphState > myneighbors
bool DoSingleStepDPMX(std::vector< graphState > &thePath)
PropUtil::NodeLookupTable closedList
size_t operator()(const SearchNode &x) const
bool UpdateHOnly(PropUtil::SearchNode &node, double h)
bool DoSingleStepBPMX(std::vector< graphState > &thePath)
bool DoSingleStepB(std::vector< graphState > &thePath)
uint64_t GetNodesFirstExpanded()
bool InitializeSearch(GraphEnvironment *env, Graph *_g, graphState from, graphState to, std::vector< graphState > &thePath)
void RelaxOpenNode(double f, double g, graphState neighbor, PropUtil::SearchNode &neighborNode, graphState topNodeID)
PropUtil::GQueue delayCache
bool operator()(const SearchNode &i1, const SearchNode &i2) const
bool fless(double a, double b)
bool operator()(const SearchNode &, const SearchNode &) const
std::vector< graphState > neighbors
bool operator()(const SearchNode &i1, const SearchNode &i2) const
bool DoSingleStepDP(std::vector< graphState > &thePath)
SearchNode(graphState curr)
void Broadcast(int level, int levelcount)
static void GetLoc(node *n, double &x, double &y, double &z)
bool fgreater(double a, double b)
A simple & efficient Heap class.
StateEX(graphState s, double w)
void ReverseProp(PropUtil::SearchNode &topNode)
bool DoSingleStepA(std::vector< graphState > &thePath)
PropUtil::TQueue WaitList
void ExtractPathToStart(graphState goalNode, std::vector< graphState > &thePath)
SearchNodeEX(SearchNode &n, double w)
OpenListB< PropUtil::SearchNode, PropUtil::SearchNodeHash, PropUtil::SearchNodeEqual, PropUtil::SearchNodeCompare, PropUtil::GGreater, PropUtil::FExtract > PQueue
double GetLabelF(unsigned int index) const
Prop(unsigned int v, double del)
std::deque< graphState > fifo
void copy(double f, double g, graphState curr, graphState prev)
void GetPath(GraphEnvironment *env, Graph *_g, graphState from, graphState to, std::vector< graphState > &thePath)
bool DoSingleStepBPMXE(std::vector< graphState > &thePath)
bool DoSingleSearchStep(std::vector< graphState > &thePath)
std::unordered_map< graphState, PropUtil::SearchNode > NodeLookupTable
bool fequal(double a, double b, double tolerance=TOLERANCE)
bool DoSingleStepApprox(std::vector< graphState > &thePath)
bool operator()(const SearchNode &i1, const SearchNode &i2) const
static Graph * genFig3(unsigned int N)
static Graph * genFig1(unsigned int N)
OpenListB< PropUtil::SearchNode, PropUtil::SearchNodeHash, PropUtil::SearchNodeEqual, PropUtil::TGreater, PropUtil::GGreater, PropUtil::FExtract > TQueue
uint64_t GetNodesExpanded()
Nodes to be stored within a Graph.
bool DoSingleStepDelay(std::vector< graphState > &thePath)
Edge class for connections between node in a Graph.