Skip to content

Commit 85324a5

Browse files
qxz5u9gdoofenshirmtz
authored andcommitted
modified rewards, observations and scores
1 parent 5577300 commit 85324a5

2 files changed

Lines changed: 649 additions & 0 deletions

File tree

ocean/drmario/binding.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "drmario.h"
2+
3+
#define OBS_SIZE 133
4+
#define NUM_ATNS 1
5+
#define ACT_SIZES {7}
6+
#define OBS_TENSOR_T FloatTensor
7+
8+
#define Env DrMario
9+
#include "vecenv.h"
10+
11+
void my_init(Env* env, Dict* kwargs) {
12+
env->num_agents=1;
13+
env->n_rows = dict_get(kwargs, "n_rows")->value;
14+
env->n_cols = dict_get(kwargs, "n_cols")->value;
15+
env->n_init_viruses = dict_get(kwargs, "n_init_viruses")->value;
16+
c_init(env);
17+
}
18+
19+
void my_log(Log* log, Dict* out) {
20+
dict_set(out, "perf", log->perf);
21+
dict_set(out, "score", log->score);
22+
dict_set(out, "episode_return", log->episode_return);
23+
dict_set(out, "episode_length", log->episode_length);
24+
dict_set(out, "viruses_cleared", log->viruses_cleared);
25+
}

0 commit comments

Comments
 (0)