Skip to content

Commit

Permalink
fix delayed reset bug
Browse files Browse the repository at this point in the history
  • Loading branch information
taufeeque9 committed May 27, 2024
1 parent 9b32dd0 commit 1abbeb8
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 @@ -142,7 +142,11 @@ void SokobanEnv::Step(const Action& action_dict) {
reward_box_ * static_cast<double>(prev_unmatched_boxes -
unmatched_boxes_) +
((unmatched_boxes_ == 0) ? reward_finished_ : 0.0f);
WriteState(static_cast<float>(reward));
if (IsDone()) {
Reset();
} else {
WriteState(static_cast<float>(reward));
}
}

constexpr std::array<std::array<uint8_t, 3>, kPlayerOnTarget + 1> kTinyColors{{
Expand Down

0 comments on commit 1abbeb8

Please sign in to comment.