Skip to content

Conversation

@HarryXuancy
Copy link
Contributor

In this PR I modify the legal actions in RockSample environment:

  1. Sample action is always allowed without any penalty --> Only allow to sample when the agent is in the position of a rock.
  2. After a rock is sampled, it is replaced by a bad rock --> After a rock is sampled, it can not be sampled or checked anymore. We can regard it as removed from the environment.

These new settings align with Silver's cpp code and can bring better results since the search space is smaller. I am not sure if pomdp-py wants to adopt this new setting, you can decide whether to merge based on the need.

Copy link
Collaborator

@zkytony zkytony left a comment

Choose a reason for hiding this comment

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

Thank you! Great work.

Requesting a few changes; see comments.

Also, could you add some unit tests? Those can go in pomdp_py/tests. There's a custom test framework here and it should be easy to understand. These tests are run by CI so ensures your work is preserved in a working state.

print(f"Max total reward: {max(total_rewards)}")
print(f"Min discounted reward: {min(total_discounted_rewards):.3f}")
print(f"Max discounted reward: {max(total_discounted_rewards):.3f}")
print("="*50)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you separate this part into a function called run_experiment or benchmark? Then, if a user runs

python -m pomdp_py -r rocksample --benchmark

it will run this. Otherwise, it still runs a single-run example?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added this here: #85

@zkytony
Copy link
Collaborator

zkytony commented Oct 3, 2025

@HarryXuancy also notice the pre-commit check fails.

@zkytony
Copy link
Collaborator

zkytony commented Oct 25, 2025

@HarryXuancy I see this has become stale. I'll see if I can get this pass CI. Also I noticed two of my comments were resolved without reason. Specifically, it doesn't look like the code is generating output.txt files so I don't think we need to add it in gitignore.

@zkytony
Copy link
Collaborator

zkytony commented Oct 25, 2025

@HarryXuancy please check out this one #85
Feel free to review. It has basically all your changes + the benchmark flag. I am waiting for the benchmark to finish & will report the numbers.

@HarryXuancy
Copy link
Contributor Author

@HarryXuancy I see this has become stale. I'll see if I can get this pass CI. Also I noticed two of my comments were resolved without reason. Specifically, it doesn't look like the code is generating output.txt files so I don't think we need to add it in gitignore.

Sorry for my big delay! And I resolved the comments because of my personal habit. If I think a comment is absolutely correct, I usually just apply the corresponding change without adding a reply. Sorry I probably should have added some responses before resolving the comments.

zkytony added a commit that referenced this pull request Oct 28, 2025
* Modify legal actions of rocksample

* allow --benchmark in rocksample

* pre-commit

* remove gitignore

* minor hash improvement

---------

Co-authored-by: Chunyu Xuan <lhsxxcy@126.com>
@zkytony
Copy link
Collaborator

zkytony commented Oct 28, 2025

Merged by #85

@zkytony zkytony closed this Oct 28, 2025
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