18 #include <sys/resource.h>
28 static double lastLength, lastTime;
29 static node *r1 = 0, *r2 = 0;
36 if ((!repeat) || (r1 == 0) || (r2 == 0))
52 cout <<
"Attempting path between nodes:" << endl;
53 cout << (*r1) << endl << (*r2) << endl;
66 AbsoluteTime startTime = UpTime();
68 clock_t startTime, endTime;
89 AbsoluteTime stopTime = UpTime();
90 Nanoseconds diff = AbsoluteDeltaToNanoseconds(stopTime, startTime);
91 uint64_t nanosecs = UnsignedWideToUInt64(diff);
95 duration=(
long double)(endTime-startTime)/CLOCKS_PER_SEC;
108 length += sqrt(t1*t1+t2*t2);
114 cout <<
"Steps: " << cnt <<
", len: " << length <<
", time: " << (double)nanosecs/1000000.0
116 cout <<
"ms, h() = " << aMap->
h(r1, r2) <<
", nodes: " << sa->
GetNodesExpanded() << endl;
122 lastTime = (double)nanosecs;
124 cout <<
"Comparison: " << lastLength/length <<
"x longer; but " << (double)nanosecs/lastTime <<
"x faster." << endl;