38 #define DEBUG_GMAA_POLS 0
49 _m_verboseness(verboseness),
69 if (
this == &o)
return *
this;
71 throw(
"GeneralizedMAAStarPlanner::operator= not implemented");
105 tck_start = times(&ts_start);
111 double maxLB = -DBL_MAX;
115 cout <<
"GMAA initialized with empty policy:"<<endl;
127 cout <<
"\n---------------------------------------------------\n";
128 cout <<
"-->>Start of new GMAA iteration, polpool size="<<
129 pp_p->
Size()<<
"<<--"<<endl;
135 size_t depth_sel = jpol_sel->
GetDepth();
137 cout <<
"Select returned the following policy to expand:\n";
139 cout <<
"of depth="<< depth_sel <<
" and heur. val="<<v_sel<<endl;
148 cout<<
"highest upper < best found lower bound, stopping\n";
167 throw E(
"GeneralizedMAAStarPlanner.cpp:policy pool empty? - should not happen?");
171 cout <<
"\n>>>The next policies found, poolOfNextPolicies:"<<endl;
173 *pp_copy = *poolOfNextPolicies;
174 while(! pp_copy->
Empty())
186 if(are_LBs && poolOfNextPolicies->
Size() > 0)
191 double bestNextVal = bestRanked_ppi->
GetValue();
192 if(bestNextVal > maxLB)
195 *bestJPol = *(bestRanked_ppi->
GetJPol());
197 cout <<
"new bestJPol (and max. lowerbound) found!" << endl;
198 cout <<
"Its value v="
199 << bestNextVal <<
" - "
203 cout <<
"new bestJPol->SoftPrint():"<<bestJPol->
SoftPrint();
210 tck_cur = times(&ts_cur);
211 clock_t diff = tck_cur - tck_start;
212 its << diff <<
"\t" << maxLB << endl;
217 delete bestRanked_ppi;
221 pp_p->
Union(poolOfNextPolicies);
223 delete poolOfNextPolicies;
225 if( _m_maxJPolPoolSize < pp_p->Size())
230 cout <<
"\nGMAA::Plan::iteration ending, best policy found so far:";
233 cout << endl << bestJPol->
SoftPrint() <<endl;
237 while(! pp_p->
Empty() );
245 cout <<
"\nGMAA::Plan ending, best policy found: ";
258 cout <<
"GMAA::Plan GMAA ENDED"<<endl;
270 double bestLB,
size_t k)
276 while(!poolOfNextPolicies->
Empty())
277 poolOfNextPolicies->
Pop();
283 while(poolOfNextPolicies->
Size() > 0 )
287 if(nr_done >= k || best_ppi->
GetValue() < bestLB)
304 *poolOfNextPolicies = *pp_new;
306 while(pp_new->
Size() > 0)
324 while(ppPruned->
Size()<k)