if setup, don't even start the uct
//Engine::doSearch ... if (board->isSetupPhase()){ bestMove_ = initialSetup(board->getPlayerToMove() == GOLD); return; }
initialise and start the search entities
... timeManager_->startClock(); for(t=0; t<threadsNum; t++){ ucts[t] = new Uct(board, masterUct); //wrapper for all stuff neccessary for search start SearchStartKit * s = new SearchStartKit(board, this, ucts[t]); //Engine::searchTreeWrapper runs the Uct::doSearch rc = pthread_create(&threads[t], &attr, Engine::searchTreeWrapper,(void*) s); if (rc) { stringstream ss; ss << "Fatal thread error no. " << rc << " when creating."; logError(ss.str().c_str()); exit(1); } }
search finalization and results mockup
... for(t=0; t<threadsNum; t++){ rc = pthread_join(threads[t], &status); if (rc) { stringstream ss; ss << "Fatal thread error no. " << rc << " when joining."; logWarning(ss.str().c_str()); pthread_detach(threads[t]); } } timeManager_->stopClock(); //go through ucts from different threads and collect statistics into masterUct mockupSearchResults(board, ucts, masterUct, threadsNum); ... //end Engine::doSearch
1.5.7.1