MCPcopy Create free account
hub / github.com/Gecode/gecode / trashWorks

Method trashWorks

contribs/qecode/WorkManager.cc:348–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346
347
348void WorkManager::trashWorks(vector<int> prefix) {
349 // cout<<" TW called on ";
350 // if (prefix.empty()) cout<<"empty";
351 // for (int i=0;i< prefix.size();i++) cout<<prefix[i]<<" ";
352 // cout<<endl;
353
354 Todos.trash(prefix);
355 for (list<AQWorker*>::iterator i=actives.begin();i!=actives.end();i++) {
356 if (isPrefix(prefix,(*i)->workPosition())) {
357 // cout<<" TW stopping worker on";
358 // vector<int> plop = (*i)->workPosition();
359 // if (plop.empty()) cout<<"empty";
360 // for (int j=0;j< plop.size();j++) cout<<plop[j]<<" ";
361 // cout<<endl;
362 (*i)->stopAndForget();
363 i=actives.erase(i);
364 i--;
365 }
366 }
367}
368
369void WorkManager::printStatus() {
370 mex.acquire();

Callers

nothing calls this directly

Calls 6

isPrefixFunction · 0.85
trashMethod · 0.80
workPositionMethod · 0.80
stopAndForgetMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected