34 if (!InitializeSearch(_env,_g,from,to,thePath))
40 while(!DoSingleSearchStep(thePath))
82 strcpy(algname,
"Approx");
84 strcpy(algname,
"BFSRepair");
86 strcpy(algname,
"Delay");
88 strcpy(algname,
"Dual Prop");
90 strcpy(algname,
"BPMX");
92 strcpy(algname,
"DPMX");
94 strcpy(algname,
"BPMXE");
96 strcpy(algname,
"DPDLMX");
98 printf(
"I don't know what to do.\n");
112 SearchNode first(env->HCost(start, goal), 0, start, start);
113 openQueue.Add(first);
124 return DoSingleStepA(thePath);
126 return DoSingleStepB(thePath);
128 return DoSingleStepBP(thePath);
130 return DoSingleStepApprox(thePath);
132 return DoSingleStepBFS(thePath);
134 return DoSingleStepDelay(thePath);
136 return DoSingleStepDP(thePath);
138 return DoSingleStepBPMX(thePath);
140 return DoSingleStepDPMX(thePath);
142 return DoSingleStepBPMXE(thePath);
144 return DoSingleStepDPDLMX(thePath);
182 double envH = env->HCost(
neighbor,goal);
183 h =
max(envH , altH);
192 if (f < neighborNode.
fCost)
195 openQueue.DecreaseKey(neighborNode);
200 openQueue.IncreaseKey(neighborNode);
208 if (g < neighborNode.
gCost)
211 delayCache.DecreaseKey(neighborNode);
216 delayCache.IncreaseKey(neighborNode);
225 if (openQueue.size() == 0)
238 closedList[topNodeID] = topNode;
248 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
251 justExpanded = topNodeID;
254 if (env->GoalTest(topNodeID, goal))
256 ExtractPathToStart(topNodeID, thePath);
267 env->GetSuccessors(topNodeID, neighbors);
280 for (
unsigned int x = 0; x<neighbors.size(); x++)
286 double edgeWeight = env->GCost(topNodeID,
neighbor);
287 double g = topNode.
gCost + edgeWeight;
288 double h = env->HCost(
neighbor,goal);
299 NodeLookupTable::iterator iter = closedList.find(
neighbor);
300 if (iter != closedList.end()) {
301 neighborNode = iter->second;
317 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
334 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
338 openQueue.DecreaseKey(neighborNode);
349 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
359 openQueue.Add(neighborNode);
379 if (openQueue.size() == 0)
393 if (
fless(openQueue.top().fCost , F))
397 printf(
"Expanding a node below F.\n");
401 topNode = openQueue.Remove();
408 printf(
"F updated to %lf.\n",F);
420 closedList[topNodeID] = topNode;
423 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
426 justExpanded = topNodeID;
429 if (env->GoalTest(topNodeID, goal))
431 ExtractPathToStart(topNodeID, thePath);
440 env->GetSuccessors(topNodeID, neighbors);
454 for (
unsigned int x = 0; x<neighbors.size(); x++)
460 double edgeWeight = env->GCost(topNodeID,
neighbor);
461 double g = topNode.
gCost + edgeWeight;
462 double h = env->HCost(
neighbor,goal);
473 NodeLookupTable::iterator iter = closedList.find(
neighbor);
474 if (iter != closedList.end()) {
475 neighborNode = iter->second;
491 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
508 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
512 openQueue.DecreaseKey(neighborNode);
523 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
533 openQueue.Add(neighborNode);
553 if (openQueue.size() == 0)
568 if (
fless(openQueue.top().fCost , F))
572 printf(
"Expanding a node below F.\n");
580 topNode = openQueue.Remove();
587 printf(
"F updated to %lf.\n",F);
598 closedList[topNodeID] = topNode;
602 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
605 justExpanded = topNodeID;
608 if (env->GoalTest(topNodeID, goal))
610 ExtractPathToStart(topNodeID, thePath);
622 env->GetSuccessors(topNodeID, neighbors);
627 double minH2 = DBL_MAX;
639 for (
unsigned int x = 0; x<neighbors.size(); x++)
645 double edgeWeight = env->GCost(topNodeID,
neighbor);
646 double g = topNode.
gCost + edgeWeight;
660 NodeLookupTable::iterator iter = closedList.find(
neighbor);
661 if (iter != closedList.end()) {
662 neighborNode = iter->second;
670 ComputeNewHMero3a(h, h_tmp,
neighbor, neighborNode, hTop - edgeWeight, mode);
675 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
681 minH2 =
min(minH2, h + edgeWeight);
692 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
709 if (UpdateHOnly(neighborNode, h))
710 openQueue.IncreaseKey(neighborNode);
716 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
719 RelaxOpenNode(f, g,
neighbor, neighborNode, topNodeID);
729 if (UpdateHOnly(neighborNode, h))
730 closedList[
neighbor] = neighborNode;
736 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
745 openQueue.Add(neighborNode);
755 closedList[topNodeID] = topNode;
759 printf(
"Improving h of node %ld by Mero rule (b), %lf->%lf\n",topNodeID,hTop,minH2);
777 if (openQueue.size() == 0)
801 topNode = openQueue.Remove();
808 printf(
"F updated to %lf.\n",F);
814 closedList[topNodeID] = topNode;
818 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
821 justExpanded = topNodeID;
824 if (env->GoalTest(topNodeID, goal))
826 ExtractPathToStart(topNodeID, thePath);
836 env->GetSuccessors(topNodeID, neighbors);
853 for (
unsigned int x = 0; x<neighbors.size(); x++)
859 double edgeWeight = env->GCost(topNodeID,
neighbor);
860 double g = topNode.
gCost + edgeWeight;
864 double h = env->HCost(
neighbor,goal);
874 NodeLookupTable::iterator iter = closedList.find(
neighbor);
875 if (iter != closedList.end()) {
876 neighborNode = iter->second;
889 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
906 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
931 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
934 RelaxOpenNode(f, g,
neighbor, neighborNode, topNodeID);
952 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
956 double oldG = neighborNode.
gCost;
960 closedList[
neighbor] = neighborNode;
967 openQueue.Add(neighborNode);
996 double f = h + neighborNode.
gCost;
997 neighborNode.
fCost = f;
1010 gNode = openQueue.FindSpecialMin(F);
1012 double fCost = gNode.
fCost;
1015 openQueue.DecreaseKey(gNode);
1018 gNode.
fCost = fCost;
1024 gNode = openQueue.FindTieFMin(F);
1026 double fCost = gNode.
fCost;
1029 openQueue.DecreaseKey(gNode);
1032 gNode.
fCost = fCost;
1048 double currentG = topNode.
gCost;
1049 for (
unsigned int x=0;x<neighbors.size();x++)
1054 double newG = env->GCost(topNodeID,
neighbor) + neighborNode.
gCost;
1055 if (currentG > newG) {
1061 NodeLookupTable::iterator iter = closedList.find(
neighbor);
1062 if (iter != closedList.end()) {
1063 neighborNode = iter->second;
1064 double newG = env->GCost(topNodeID,
neighbor) + neighborNode.
gCost;
1065 if (currentG > newG) {
1080 nodesTouched += neighbors.size();
1089 for (
unsigned int x=0;x<neighbors.size();x++)
1097 NodeLookupTable::iterator iter = closedList.find(
neighbor);
1098 if (iter != closedList.end()) {
1099 neighborNode = iter->second;
1103 if (bpmxLevel > 1 && oh < maxh) {
1118 nodesTouched += neighbors.size();
1131 double currentG = topNode.
gCost;
1133 for (
unsigned int x=0;x<neighbors.size();x++)
1139 double newG =
edge + neighborNode.
gCost;
1147 NodeLookupTable::iterator iter = closedList.find(
neighbor);
1148 if (iter != closedList.end()) {
1149 neighborNode = iter->second;
1151 double newG =
edge + neighborNode.
gCost;
1182 nodesTouched += neighbors.size();
1187 NodeLookupTable::iterator iter;
1191 for (
int i=0;i<levelcount;i++) {
1195 iter = closedList.find(front);
1196 if (iter == closedList.end())
1200 double frontH = frontNode.
fCost - frontNode.
gCost;
1202 myneighbors.clear();
1203 env->GetSuccessors(front, myneighbors);
1206 for (
unsigned int x = 0; x < myneighbors.size(); x++)
1210 if (iter != closedList.end()) {
1211 double edgeWeight = env->GCost(front,
neighbor);
1214 double neighborH = neighborNode.
fCost - neighborNode.
gCost;
1216 if (
fgreater(neighborH - edgeWeight, frontH)) {
1217 frontH = neighborH - edgeWeight;
1225 double edgeWeight = env->GCost(front,
neighbor);
1227 double neighborH = neighborNode.
fCost - neighborNode.
gCost;
1229 if (
fgreater(neighborH - edgeWeight, frontH)) {
1230 frontH = neighborH - edgeWeight;
1250 closedList[front] = frontNode;
1253 for (
unsigned int x = 0; x < myneighbors.size(); x++)
1256 NodeLookupTable::iterator theIter = closedList.find(
neighbor);
1257 if (theIter != closedList.end()) {
1258 double edgeWeight = env->GCost(front,
neighbor);
1261 double neighborH = neighborNode.
fCost - neighborNode.
gCost;
1263 if (
fgreater(frontH - edgeWeight, neighborH)) {
1264 neighborNode.
fCost = neighborNode.
gCost + frontH - edgeWeight;
1265 closedList[
neighbor] = neighborNode;
1272 double edgeWeight = env->GCost(front,
neighbor);
1274 double neighborH = neighborNode.
fCost - neighborNode.
gCost;
1276 if (
fgreater(frontH - edgeWeight, neighborH)) {
1277 neighborNode.
fCost = neighborNode.
gCost + frontH - edgeWeight;
1278 openQueue.IncreaseKey(neighborNode);
1283 double edgeWeight = env->GCost(front,
neighbor);
1284 double neighborH = neighborNode.
fCost - neighborNode.
gCost;
1286 if (
fgreater(frontH - edgeWeight, neighborH)) {
1287 neighborNode.
fCost = neighborNode.
gCost + frontH - edgeWeight;
1288 delayCache.IncreaseKey(neighborNode);
1301 nodesTouched += 2*levelcount;
1304 if (level < bpmxLevel && fifo.size() > 0)
1305 Broadcast(level, fifo.size());
1313 if (openQueue.size() == 0)
1336 topNode = openQueue.Remove();
1343 printf(
"F updated to %lf.\n",F);
1355 neighbors.resize(0);
1356 env->GetSuccessors(topNode.
currNode, neighbors);
1362 bool doReverse =
false;
1370 ReversePropX2(topNode);
1372 ReverseProp(topNode);
1390 closedList[topNodeID] = topNode;
1394 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
1397 justExpanded = topNodeID;
1400 if (env->GoalTest(topNodeID, goal))
1404 ExtractPathToStart(topNodeID, thePath);
1417 double minH2 = DBL_MAX;
1430 for ( x = 0,ichild=1; x<neighbors.size(); x++,ichild++)
1436 double edgeWeight = env->GCost(topNodeID,
neighbor);
1437 double g = topNode.
gCost + edgeWeight;
1451 NodeLookupTable::iterator iter = closedList.find(
neighbor);
1452 if (iter != closedList.end()) {
1453 neighborNode = iter->second;
1462 ComputeNewHMero3a(h, h_tmp,
neighbor, neighborNode, hTop - edgeWeight, mode);
1473 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
1477 if (
fgreater(h - edgeWeight , hTop)) {
1487 topNode.
fCost = topNode.
gCost + h - edgeWeight;
1495 minH2 =
min(minH2, h + edgeWeight);
1506 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
1544 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
1547 RelaxOpenNode(f, g,
neighbor, neighborNode, topNodeID);
1572 if (UpdateHOnly(neighborNode, h))
1573 closedList[
neighbor] = neighborNode;
1579 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
1588 openQueue.Add(neighborNode);
1599 closedList[topNodeID] = topNode;
1603 printf(
"Improving h of node %ld by Mero rule (b), %lf->%lf\n",topNodeID,hTop,minH2);
1622 if (openQueue.size() == 0)
1637 if (
fless(openQueue.top().fCost , F))
1639 GetLowestG(topNode);
1641 printf(
"Expanding a node below F.\n");
1645 topNode = openQueue.Remove();
1652 printf(
"F updated to %lf.\n",F);
1665 neighbors.resize(0);
1666 env->GetSuccessors(topNode.
currNode, neighbors);
1670 bool doBPMX =
false;
1677 ReversePropX1(topNode);
1696 closedList[topNodeID] = topNode;
1700 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
1703 justExpanded = topNodeID;
1706 if (env->GoalTest(topNodeID, goal))
1708 ExtractPathToStart(topNodeID, thePath);
1717 double minH2 = DBL_MAX;
1730 for (x = 0,ichild=1; x<neighbors.size(); x++,ichild++)
1736 double edgeWeight = env->GCost(topNodeID,
neighbor);
1737 double g = topNode.
gCost + edgeWeight;
1751 NodeLookupTable::iterator iter = closedList.find(
neighbor);
1752 if (iter != closedList.end()) {
1753 neighborNode = iter->second;
1761 ComputeNewHMero3a(h, h_tmp,
neighbor, neighborNode, hTop - edgeWeight, mode);
1766 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
1769 if (
fgreater(h - edgeWeight , hTop)) {
1779 topNode.
fCost = topNode.
gCost + h - edgeWeight;
1787 minH2 =
min(minH2, h + edgeWeight);
1798 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
1815 if (UpdateHOnly(neighborNode, h))
1816 openQueue.IncreaseKey(neighborNode);
1822 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
1825 RelaxOpenNode(f, g,
neighbor, neighborNode, topNodeID);
1835 if (UpdateHOnly(neighborNode, h)) {
1836 closedList[
neighbor] = neighborNode;
1846 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
1855 openQueue.Add(neighborNode);
1865 closedList[topNodeID] = topNode;
1869 printf(
"Improving h of node %ld by Mero rule (b), %lf->%lf\n",topNodeID,hTop,minH2);
1875 if (fifo.size() > 0) {
1876 Broadcast(1,fifo.size());
1916 if (goal == openQueue.top().currNode)
1919 while(delayCache.size() > 0 && delayCache.top().gCost < openQueue.top().fCost) {
1920 topNode = delayCache.Remove();
1921 if (topNode.
fCost < openQueue.top().fCost) {
1927 topNode = openQueue.Remove();
1930 else if (delayCache.size() > 0)
1932 if (openQueue.size() ==0 || (reopenings < fDelay(nodesExpanded-NodesReopened) && delayCache.top().gCost < openQueue.top().fCost)) {
1933 topNode = delayCache.Remove();
1937 topNode = openQueue.Remove();
1941 else if (openQueue.size() > 0)
1943 topNode = openQueue.Remove();
1976 neighbors.resize(0);
1977 env->GetSuccessors(topNode.
currNode, neighbors);
1981 bool doReverse =
false;
1989 ReversePropX2(topNode);
1991 ReverseProp(topNode);
2001 closedList[topNodeID] = topNode;
2005 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
2008 justExpanded = topNodeID;
2011 if (env->GoalTest(topNodeID, goal))
2015 ExtractPathToStart(topNodeID, thePath);
2029 double minH2 = DBL_MAX;
2042 for ( x = 0,ichild=1; x<neighbors.size(); x++,ichild++)
2048 double edgeWeight = env->GCost(topNodeID,
neighbor);
2049 double g = topNode.
gCost + edgeWeight;
2063 NodeLookupTable::iterator iter = closedList.find(
neighbor);
2064 if (iter != closedList.end()) {
2065 neighborNode = iter->second;
2078 ComputeNewHMero3a(h, h_tmp,
neighbor, neighborNode, hTop - edgeWeight, mode);
2089 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
2093 if (
fgreater(h - edgeWeight , hTop)) {
2094 topNode.
fCost = topNode.
gCost + h - edgeWeight;
2102 minH2 =
min(minH2, h + edgeWeight);
2113 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
2142 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
2145 RelaxOpenNode(f, g,
neighbor, neighborNode, topNodeID);
2156 if (UpdateHOnly(neighborNode, h))
2157 delayCache.IncreaseKey(neighborNode);
2161 RelaxDelayNode(f, g,
neighbor, neighborNode, topNodeID);
2176 if (UpdateHOnly(neighborNode, h))
2177 closedList[
neighbor] = neighborNode;
2183 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
2190 openQueue.Add(neighborNode);
2201 closedList[topNodeID] = topNode;
2205 printf(
"Improving h of node %ld by Mero rule (b), %lf->%lf\n",topNodeID,hTop,minH2);
2218 if (openQueue.size() == 0)
2233 if (
fless(openQueue.top().fCost , F))
2235 GetLowestG(topNode);
2237 printf(
"Expanding a node below F.\n");
2241 topNode = openQueue.Remove();
2248 printf(
"F updated to %lf.\n",F);
2253 neighbors.resize(0);
2254 env->GetSuccessors(topNode.
currNode, neighbors);
2259 ReversePropX2(topNode);
2264 closedList[topNodeID] = topNode;
2268 printf(
"Expanding node %ld , g=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
2271 justExpanded = topNodeID;
2274 if (env->GoalTest(topNodeID, goal))
2278 ExtractPathToStart(topNodeID, thePath);
2291 double minH2 = DBL_MAX;
2303 for (
unsigned int x = 0; x<neighbors.size(); x++)
2309 double edgeWeight = env->GCost(topNodeID,
neighbor);
2310 double g = topNode.
gCost + edgeWeight;
2324 NodeLookupTable::iterator iter = closedList.find(
neighbor);
2325 if (iter != closedList.end()) {
2326 neighborNode = iter->second;
2334 ComputeNewHMero3a(h, h_tmp,
neighbor, neighborNode, hTop - edgeWeight, mode);
2339 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
2345 minH2 =
min(minH2, h + edgeWeight);
2356 printf(
"Adding node %ld to OPEN, g=%lf, h=%lf, f=%lf.\n",
neighbor,g,f-g,f);
2372 if (UpdateHOnly(neighborNode, h))
2373 openQueue.IncreaseKey(neighborNode);
2379 printf(
"Adjusting node %ld in OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
2382 RelaxOpenNode(f, g,
neighbor, neighborNode, topNodeID);
2392 if (UpdateHOnly(neighborNode, h))
2393 closedList[
neighbor] = neighborNode;
2399 printf(
"Moving node %ld from CLOSED to OPEN, g=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,g,f-g,f, neighborNode.
gCost);
2406 openQueue.Add(neighborNode);
2416 closedList[topNodeID] = topNode;
2420 printf(
"Improving h of node %ld by Mero rule (b), %lf->%lf\n",topNodeID,hTop,minH2);
2432 NodeLookupTable::iterator iter;
2434 closedSize = closedList.size();
2436 if (closedList.find(goalNode) != closedList.end())
2438 n = closedList[goalNode];
2440 else n = openQueue.find(
SearchNode(goalNode));
2442 solutionCost = n.
gCost;
2451 iter = closedList.find(n.
prevNode);
2452 if (iter != closedList.end())
2459 pathSize = thePath.size();
2560 void Prop::DrawText(
double x,
double y,
double z,
float r,
float gg,
float b,
char* str)
2567 glTranslatef(x,y,z);
2568 glScalef(1.0/(20*120.0), 1.0/(20*120.0), 1);
2569 glRotatef(180, 0.0, 0.0, 1.0);
2570 glRotatef(180, 0.0, 1.0, 0.0);
2585 char buf[100] = {0};
2587 node* nfrom = grp->GetNode(from);
2588 node* nto = grp->GetNode(to);
2596 glVertex3f(x1,y1,z1);
2597 glVertex3f(x2,y2,z2);
2602 sprintf(buf,
"%ld",(
long)weight);
2603 DrawText((x1+x2)/2, (y1+y2)/2, (z1+z2)/2 - 0.15, 1, 0, 0, buf);