Skip to content
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

Add several accelerations to custom output #939

Merged
merged 94 commits into from
May 27, 2020

Conversation

liljonnystyle
Copy link
Collaborator

@liljonnystyle liljonnystyle commented May 21, 2020

Pull request information

  • Status: ready to merge
  • Kind of changes: new feature

Description

Adding more accelerations to the custom data pipeline output.

  • Target acceleration without noise and without failsafes (target_accel_no_noise_no_failsafe, new)
  • Target acceleration without noise and with failsafes (target_accel_no_noise_with_failsafe, formerly accel_without_noise)
  • Target acceleration with noise and without failsafes (target_accel_with_noise_no_failsafe, new)
  • Target acceleration with noise and with failsafes (target_accel_with_noise_with_failsafe, formerly acceleration)
  • Realized acceleration (no change)

@liljonnystyle liljonnystyle changed the base branch from datapipeline_dev to i210_dev May 25, 2020 23:50
liljonnystyle and others added 4 commits May 25, 2020 16:57
* added function to kernel/vehicle to get number of not departed vehiles

* fixed over indentation of the docstring

* indentation edit

* pep8

Co-authored-by: AboudyKreidieh <[email protected]>
Comment on lines 116 to 119
self.__vehicles[veh_id]["accel_no_noise_no_failsafe"] = None
self.__vehicles[veh_id]["accel_no_noise_with_failsafe"] = None
self.__vehicles[veh_id]["accel_with_noise_no_failsafe"] = None
self.__vehicles[veh_id]["accel_with_noise_with_failsafe"] = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since there is a key existence check in all the get methods below. There is no need to initialize them here.

@@ -964,6 +967,20 @@ def apply_acceleration(self, veh_ids, acc):
next_vel = max([this_vel + acc[i] * self.sim_step, 0])
self.kernel_api.vehicle.slowDown(vid, next_vel, 1e-3)

def apply_acceleration_not_smooth(self, veh_ids, acc):
"""See parent class."""
# to hand the case of a single vehicle
Copy link
Member

Choose a reason for hiding this comment

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

nit: to handle

Comment on lines +977 to +982
for i, vid in enumerate(veh_ids):
if acc[i] is not None and vid in self.get_ids():
self.__vehicles[vid]["accel"] = acc[i]
this_vel = self.get_speed(vid)
next_vel = max([this_vel + acc[i] * self.sim_step, 0])
self.kernel_api.vehicle.setSpeed(vid, next_vel)
Copy link
Member

Choose a reason for hiding this comment

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

how is this different than the normal method?

Copy link
Collaborator

Choose a reason for hiding this comment

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

the normal method uses slowDown() method which applies some sort of smoothing. here setSpeed() method is used which doesn't apply smoothing.

@liljonnystyle liljonnystyle merged commit 243c895 into i210_dev May 27, 2020
@liljonnystyle liljonnystyle deleted the jl-more-accel-outputs branch May 27, 2020 17:06
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.

5 participants