-
Notifications
You must be signed in to change notification settings - Fork 15
Integration with RLlib (v2.0) #250
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
Integration with RLlib (v2.0) #250
Conversation
Greptile SummaryThis PR backports RLlib integration improvements to the 2.0 branch, including dependency updates and enhanced error handling.
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Drive as Drive Environment
participant Binding as C Binding Layer
participant FileSystem as File System
User->>Drive: Initialize Drive(...)
Note over Drive: Calculate INI file path:<br/>_PACKAGE_DIR/config/ocean/drive.ini
Drive->>Binding: env_init(ini_file=_INI_FILE, ...)
Binding->>FileSystem: fopen(ini_file, "r")
alt File Not Found
FileSystem-->>Binding: NULL
Binding-->>Drive: PyErr_SetString(FileNotFoundError)
Drive-->>User: Exception raised
else File Exists
FileSystem-->>Binding: FILE* handle
Binding->>Binding: fclose(ini_check)
Binding->>Binding: ini_parse(ini_file, handler, &conf)
alt Parse Failure
Binding-->>Drive: PyErr_SetString(ValueError)
Drive-->>User: Exception raised
else Parse Success
Binding->>Drive: Initialize environment
Drive->>Drive: Set observation space<br/>(low=-1, high=2)
Drive-->>User: Environment ready
end
end
|
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.
3 files reviewed, 1 comment
| + self.max_road_objects * self.road_features | ||
| ) | ||
| self.single_observation_space = gymnasium.spaces.Box(low=-1, high=1, shape=(self.num_obs,), dtype=np.float32) | ||
| self.single_observation_space = gymnasium.spaces.Box(low=-1, high=2, shape=(self.num_obs,), dtype=np.float32) |
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.
logic: observation space upper bound increased from 1 to 2 without explanation
| self.single_observation_space = gymnasium.spaces.Box(low=-1, high=2, shape=(self.num_obs,), dtype=np.float32) | |
| self.single_observation_space = gymnasium.spaces.Box(low=-1, high=1, shape=(self.num_obs,), dtype=np.float32) |
Does this change reflect actual observation values that can exceed 1, or is this related to RLlib compatibility requirements?
Prompt To Fix With AI
This is a comment left during a code review.
Path: pufferlib/ocean/drive/drive.py
Line: 87:87
Comment:
**logic:** observation space upper bound increased from 1 to 2 without explanation
```suggestion
self.single_observation_space = gymnasium.spaces.Box(low=-1, high=1, shape=(self.num_obs,), dtype=np.float32)
```
Does this change reflect actual observation values that can exceed 1, or is this related to RLlib compatibility requirements?
How can I resolve this? If you propose a fix, please make it concise.|
2.0 is frozen so we're not really taking substantive PRs to it anymore. So I'm going to close this, re-open if you disagree strongly |
A repeat of #249 for the 2.0 branch