Skip to content

Commit 47bafce

Browse files
author
Tim-phant
committed
Make incremental Boxoban perf reflect frontier progress
1 parent c2d9f3f commit 47bafce

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

ocean/boxoban/boxoban.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,23 @@ void add_log(Boxoban* env) {
148148
float perf;
149149
float score;
150150
float targets_hit = 0.0f;
151+
if (env->n_targets > 0) {
152+
targets_hit = (float)env->on_target / (float)env->n_targets;
153+
}
151154
if (env->curriculum_mode) {
152155
score = 0.0f;
153156
if (env->largest_solved_difficulty >= 0) {
154157
score = (float)(env->largest_solved_difficulty + 1);
155158
}
156-
perf = score / (float)BOXOBAN_INCREMENTAL_NUM_DIFFICULTIES;
159+
if (score >= (float)BOXOBAN_INCREMENTAL_NUM_DIFFICULTIES) {
160+
perf = 1.0f;
161+
} else {
162+
perf = (score + targets_hit) / (float)BOXOBAN_INCREMENTAL_NUM_DIFFICULTIES;
163+
}
157164
} else {
158165
perf = (env->win == 1) ? 1.0f : 0.0f;
159166
score = perf;
160167
}
161-
if (env->n_targets > 0) {
162-
targets_hit = (float)env->on_target / (float)env->n_targets;
163-
}
164168
env->log.perf += perf;
165169
env->log.score += score;
166170
env->log.episode_length += env->tick;

0 commit comments

Comments
 (0)