coord_t PachiEngine::genmove()

in pachi_py/goutil.cpp [154:173]


coord_t PachiEngine::genmove(stone curr_color, const std::string& timestr) {
    // Set pachi timing options (max sims, etc.)
    time_info ti;
    ti.period = time_info::TT_NULL;
    if (timestr != "" && !time_parse(&ti, const_cast<char*>(timestr.c_str()))) {
        std::stringstream ss;
        ss << "Invalid timekeeping specification for Pachi: " << timestr << '\n';
        ss << "Format:\n";
        ss << "*   =NUM - fixed number of simulations per move\n";
        ss << "*   NUM - number of seconds to spend per move (can be floating_t)\n";
        ss << "*   _NUM - number of seconds to spend per game\n";
        throw PachiEngineError(ss.str());
    }

    // Play
    coord_t* c = m_engine->genmove(m_engine, m_board->pachiboard(), &ti, curr_color, false);
    coord_t out = *c;
    coord_done(c);
    return out;
}