34 std::vector<node *> fromChain;
35 std::vector<node *> toChain;
43 if (fromChain.size() == 0)
54 std::vector<node *> &fromChain,
node *from,
55 std::vector<node *> &toChain,
node *to)
62 if ((from == 0) || (to == 0) || (!aMap->
Pathable(from, to)) || (from == to))
67 printf(
"praStar2: from == 0\n");
69 printf(
"praStar2: to == 0\n");
71 printf(
"praStar2: from == to\n");
72 if (from && to && (!aMap->
Pathable(from, to)))
73 printf(
"praStar2: no path from %p to %p\n", (
void*)from, (
void*)to);
80 printf(
"At nodes #%d and %d\n", from->
GetNum(), to->
GetNum());
90 std::vector<node *> &fromChain,
91 std::vector<node *> & toChain)
95 if (
verbose) std::cout<<
"fixed set\n";
97 while (((
int)fromChain.size() > 1) && ((
int)toChain.size() >
fixedPlanLevel + 1))
100 fromChain.pop_back();
105 if (
verbose) std::cout<<
"plan from middle\n";
108 unsigned int previousSize = fromChain.size();
111 while ((fromChain.size() > 2) &&
112 ((fromChain.size() > (previousSize)/2) ||
116 fromChain.pop_back();
122 std::cout<<
"Top praStar level: " << (toChain.size() -1) <<std::endl;
127 std::vector<node *> &fromChain,
128 std::vector<node *> &toChain,
133 std::cout<<
"Now finding a path on level " <<(int)(toChain.size() -1) <<std::endl;
135 node *to, *from, *hTarget = 0;
137 from = fromChain.back();
139 fromChain.pop_back();
150 while(toChain.size()>1)
154 fromChain.pop_back();
161 while(toChain.size()>1 && skipme > 0)
165 fromChain.pop_back();
175 printf(
"Building path from %d to %d (%ld/%ld)\n",
176 from->GetNum(), to->GetNum(), from->GetLabelL(
kParent), to->GetLabelL(
kParent));
178 std::vector<node *> eligibleNodeParents;
185 path *trav = lastPath;
196 hTarget = trav->
next->
n;
201 if (
verbose) printf(
"Setting target parent to %d\n", to->GetNum());
208 for (
path *trav = lastPath; trav; trav = trav->
next)
213 for (
edge *e = trav->n->edgeIterNext(ei); e; e = trav->n->edgeIterNext(ei))
215 if (e->getFrom() == trav->n->GetNum())
216 eligibleNodeParents.push_back(g->
GetNode(e->getTo()));
218 eligibleNodeParents.push_back(g->
GetNode(e->getFrom()));
221 eligibleNodeParents.push_back(trav->n);
249 path *change = 0, *last = 0;
250 for (
path *trav = lastPath; trav; trav = trav->
next)
252 if (trav->n == origDest)
254 if (trav->n->GetLabelL(
kParent) != parent)