17
17
#include < stdint.h>
18
18
19
19
#include < memory>
20
- #include < new>
21
20
#include < string>
22
- #include < utility>
23
21
24
22
#include " open_spiel/algorithms/evaluate_bots.h"
25
23
#include " open_spiel/algorithms/is_mcts.h"
@@ -99,8 +97,7 @@ class PyBot : public Bot {
99
97
" inform_action" , // Name of function in Python
100
98
InformAction, // Name of function in C++
101
99
state, // Arguments
102
- player_id,
103
- action);
100
+ player_id, action);
104
101
}
105
102
void InformActions (const State& state,
106
103
const std::vector<Action>& actions) override {
@@ -153,7 +150,7 @@ class PyBot : public Bot {
153
150
} // namespace
154
151
155
152
void init_pyspiel_bots (py::module & m) {
156
- py::class_ <Bot, PyBot> bot (m, " Bot" );
153
+ py::classh <Bot, PyBot> bot (m, " Bot" );
157
154
bot.def (py::init<>())
158
155
.def (" step" , &Bot::Step)
159
156
.def (" restart" , &Bot::Restart)
@@ -227,7 +224,7 @@ void init_pyspiel_bots(py::module& m) {
227
224
.def (" to_string" , &SearchNode::ToString)
228
225
.def (" children_str" , &SearchNode::ChildrenStr);
229
226
230
- py::class_ <algorithms::MCTSBot, Bot>(m, " MCTSBot" )
227
+ py::classh <algorithms::MCTSBot, Bot>(m, " MCTSBot" )
231
228
.def (
232
229
py::init ([](std::shared_ptr<const Game> game,
233
230
std::shared_ptr<Evaluator> evaluator, double uct_c,
@@ -253,7 +250,7 @@ void init_pyspiel_bots(py::module& m) {
253
250
algorithms::ISMCTSFinalPolicyType::kMaxVisitCount )
254
251
.value (" MAX_VALUE" , algorithms::ISMCTSFinalPolicyType::kMaxValue );
255
252
256
- py::class_ <algorithms::ISMCTSBot, Bot>(m, " ISMCTSBot" )
253
+ py::classh <algorithms::ISMCTSBot, Bot>(m, " ISMCTSBot" )
257
254
.def (py::init<int , std::shared_ptr<Evaluator>, double , int , int ,
258
255
algorithms::ISMCTSFinalPolicyType, bool , bool >(),
259
256
py::arg (" seed" ), py::arg (" evaluator" ), py::arg (" uct_c" ),
0 commit comments