Skip to content

Commit

Permalink
mctsblocker: added prints after removing bad block
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslg committed Sep 10, 2024
1 parent 1f32853 commit eff6db9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mctsblock/spam/src/MCTSAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,14 @@ MCTSTree* MCTSAgent::expand(MCTSTree* ANode) {
std::pair<double,MCTSAgent::GAME_RESULT> MCTSAgent::simulate(MCTSTree* ANode) {
auto state =ANode->get_state();

bool trace_on = false;
if((ANode->get_action()->get_description() == std::string ("Remove block 26"))) {
std::cout<<"POYOP"<<std::endl;
trace_on = true;
}
//we first check that we are not a winner!!
if(state->win())
std::make_pair(m_reward_function->evaluate(state),WIN);
std::make_pair(m_reward_function->evaluate(state), WIN);

bool found_win=false;
bool found_lost =false;
Expand All @@ -96,7 +101,9 @@ std::pair<double,MCTSAgent::GAME_RESULT> MCTSAgent::simulate(MCTSTree* ANode) {
auto a = get_random_action(state);
if(a== nullptr)
exit(55);

if(trace_on) {
std::cout<<"d "<<d<<" "<<a->get_description()<<std::endl;
}
state = a->apply_on(state);
if (state->win())
found_win=true;
Expand Down

0 comments on commit eff6db9

Please sign in to comment.