26 using namespace YACS::ENGINE;
32 const char Pool::MESSAGEFORUNXSTNGID[]=
"The id specified not exists. Unable to handle with. Either internal error, or invalid use of Pool from Optimizer Algorithm";
50 if(_out!=USED_BUT_NOT_COMPUTED_YET && _out!=NOT_USED_NOR_COMPUTED)
59 if(_out!=USED_BUT_NOT_COMPUTED_YET && _out!=NOT_USED_NOR_COMPUTED)
70 _out=USED_BUT_NOT_COMPUTED_YET;
75 return _out==NOT_USED_NOR_COMPUTED;
90 return (*_currentCase).second.inValue();
98 return (*_currentCase).second.outValue();
106 std::list< std::pair<int, ExpData> >::iterator iter;
108 if((*iter).first==
id)
109 return (*iter).second.outValue();
118 std::pair<int, ExpData> eltToAdd(
id,
Pool::ExpData(inSample,priority));
144 std::list< std::pair<int, ExpData> >::iterator iter;
147 std::pair< std::set<int>::iterator,
bool > verdict=ids.insert((*iter).first);
150 std::ostringstream what;
151 what <<
"Id with value : " << (*iter).first <<
" appears several times.";
152 throw Exception(what.str());
162 std::list< std::pair<int, ExpData> >::iterator iter;
164 if((*iter).first==
id)
183 std::list< std::pair<int, ExpData> >::iterator iter;
185 if((*iter).first==
id)
188 (*iter).second.setOutValue(outValue);
207 unsigned char myPriority=0;
208 std::list< std::pair<int, ExpData> >::const_iterator iter,ptToSelected;
212 if((*iter).second.isLaunchable())
213 if((*iter).second.getPriority()>myPriority || ptToSelected==
_container.end())
216 myPriority=(*iter).second.getPriority();
223 id=(*ptToSelected).first;
224 return (*ptToSelected).second.inValue();
235 std::list< std::pair<int, ExpData> >::iterator iter;
237 if((*iter).first==
id)
239 (*iter).second.markItAsInUse();