Skip to content

Terminate episode if sdc reaches goal in replay mode'#495

Open
riccardosavorgnan wants to merge 2 commits into
3.0from
ricky/early_replay_termination
Open

Terminate episode if sdc reaches goal in replay mode'#495
riccardosavorgnan wants to merge 2 commits into
3.0from
ricky/early_replay_termination

Conversation

@riccardosavorgnan

@riccardosavorgnan riccardosavorgnan commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

When in replay mode and SDC control only it might be desirable to terminate the episode once the SDC reaches its goal. This PR implements that in drive.h, and it is controlled by a config parameter.

Comment thread pufferlib/config/ocean/drive.ini
}
}

if (env->terminate_on_goal == 1 && env->simulation_mode == SIMULATION_REPLAY

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it doesn't seem like it makes sense to gate this on CONTROL_SDC_ONLY?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It can be extended to all of replay mode, with a criteria on when the episode should terminate. I can add a threshold of % of cars that have completed their goals to trigger it, but it will come with no guarantees on what's the best value for now.

}
}

if (env->terminate_on_goal == 1 && env->simulation_mode == SIMULATION_REPLAY

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it would be fine for this to be on in both simulation modes?

@eugenevinitsky eugenevinitsky left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved but I recommend adding a test so no one else can break this feature on you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants