Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pufferlib/ocean/drive/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ static int my_log(PyObject* dict, Log* log) {
assign_to_dict(dict, "completion_rate", log->completion_rate);
assign_to_dict(dict, "lane_alignment_rate", log->lane_alignment_rate);
assign_to_dict(dict, "score", log->score);
assign_to_dict(dict, "distance_weighted_score", log->distance_weighted_score);
assign_to_dict(dict, "total_goal_distance", log->total_goal_distance);
// assign_to_dict(dict, "active_agent_count", log->active_agent_count);
// assign_to_dict(dict, "expert_static_car_count", log->expert_static_car_count);
// assign_to_dict(dict, "static_car_count", log->static_car_count);
Expand Down
6 changes: 6 additions & 0 deletions pufferlib/ocean/drive/drive.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ struct Log {
float episode_return;
float episode_length;
float score;
float distance_weighted_score;
float total_goal_distance;
float offroad_rate;
float collision_rate;
float num_goals_reached;
Expand Down Expand Up @@ -375,8 +377,12 @@ void add_log(Drive* env) {
env->log.avg_collisions_per_agent += avg_collisions_per_agent;
int num_goals_reached = env->logs[i].num_goals_reached;
env->log.num_goals_reached += num_goals_reached;
float goal_distance = ego_goal_distance_t0(e);
env->log.total_goal_distance += goal_distance;
if(e->reached_goal_this_episode && !e->collided_before_goal){
env->log.score += 1.0f;
float goal_distance = ego_goal_distance_t0(e);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, do you know where this function is defined? I can't find it in the repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 311 of drive.h

env->log.distance_weighted_score += 1.0f * goal_distance;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be curious to see the distribution of distances to the goal, do you mind adding that? (can be done with wandb.Histogram)

}
if(!offroad && !collided && !e->reached_goal_this_episode){
env->log.dnf_rate += 1.0f;
Expand Down