Skip to content

Fix negative speed issue #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 18, 2025
Merged

Fix negative speed issue #204

merged 7 commits into from
Apr 18, 2025

Conversation

toruseo
Copy link
Owner

@toruseo toruseo commented Apr 18, 2025

This addresses #203

This PR also includes DTAsolver updates. However, they are still work in progress

@toruseo toruseo enabled auto-merge April 18, 2025 09:31
@toruseo toruseo requested a review from Copilot April 18, 2025 09:31
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the negative speed issue by adjusting vehicle positions before updating their speeds and includes preliminary DTAsolver updates. It also updates the simulation notebook execution counts and reported simulation metrics.

  • Updated vehicle position logic in uxsims.py to ensure positions and boundaries are enforced.
  • Revised execution counts and simulation output metrics in the demo notebook to reflect the latest simulation results.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
uxsim/uxsim.py Adjustments in vehicle position and speed update logic
demos_and_examples/demo_notebook_01en.ipynb Updated execution counts and simulation metric outputs
Comments suppressed due to low confidence (1)

uxsim/uxsim.py:322

  • The update to veh.v may still allow negative speeds if veh.x is negative. Consider enforcing non-negative speeds by applying a max(veh.v, 0) after the update or ensuring veh.x cannot be negative.
veh.v += veh.x/s.W.DELTAT

@toruseo toruseo merged commit 7fc4a84 into main Apr 18, 2025
13 checks passed
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.

1 participant