Skip to content

Commit

Permalink
Print reward boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaps0dy committed Jan 21, 2024
1 parent 9de2c16 commit ae6a2d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion envpool/sokoban/sokoban_envpool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <array>
#include <sstream>
#include <stdexcept>
#include <iostream>

#include "envpool/core/py_envpool.h"

Expand Down Expand Up @@ -149,7 +150,10 @@ void SokobanEnv::Step(const Action& action_) {
const double reward =
reward_step +
reward_box * static_cast<double>(prev_unmatched_boxes - unmatched_boxes) +
((unmatched_boxes == 0) ? reward_finished : 0.0f);
((unmatched_boxes == 0) ? reward_finished : 0.0);
std::cout << "prev_unmatched_boxes=" << prev_unmatched_boxes
<< ", unmatched_boxes=" << unmatched_boxes
<< ", so reward=" << reward << "\n";
WriteState(static_cast<float>(reward));
}

Expand Down

0 comments on commit ae6a2d7

Please sign in to comment.