-
Notifications
You must be signed in to change notification settings - Fork 4
Tests env #36
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
base: master
Are you sure you want to change the base?
Tests env #36
Changes from 6 commits
496420c
5f1ff17
994fc88
b1279e0
8e2ef24
62417c7
1ba38b7
b4ab3d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,14 +210,13 @@ def get_state(self): | |
| lane_headways[j] /= max_length | ||
| vel_in_front[j] = self.vehicles.get_speed(lane_leader) \ | ||
| / max_speed | ||
| self.visible.extend([lane_leader]) | ||
| for j, lane_follower in enumerate(lane_followers): | ||
| if lane_follower != '': | ||
| lane_headways[j] /= max_length | ||
| vel_behind[j] = self.vehicles.get_speed(lane_follower) \ | ||
| / max_speed | ||
|
|
||
| self.visible.extend(lane_leaders) | ||
| self.visible.extend(lane_followers) | ||
| self.visible.extend([lane_follower]) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these changes just to more clearly show when the list of visible cars is being changed?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is to fix a bug where the list of visible vehicles sometimes includes '' strings |
||
|
|
||
| # add the headways, tailways, and speed for all lane leaders | ||
| # and followers | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,17 +29,20 @@ class and returns a real number. | |
|
|
||
| @property | ||
| def action_space(self): | ||
| return Box(low=0, high=0, shape=0, dtype=np.float32) | ||
| return Box(low=0, high=0, shape=(0,), dtype=np.float32) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should not be named test.py as it's a little confusing |
||
|
|
||
| @property | ||
| def observation_space(self): | ||
| return Box(low=0, high=0, shape=0, dtype=np.float32) | ||
| return Box(low=0, high=0, shape=(0,), dtype=np.float32) | ||
|
|
||
| def _apply_rl_actions(self, rl_actions): | ||
| return | ||
|
|
||
| def compute_reward(self, state, rl_actions, **kwargs): | ||
| return 0 | ||
| if "reward_fn" in self.env_params.additional_params: | ||
| return self.env_params.additional_params["reward_fn"](self) | ||
| else: | ||
| return 0 | ||
|
|
||
| def get_state(self, **kwargs): | ||
| return np.array([]) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like it's sorted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, I'll call the method here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done