-
-
Notifications
You must be signed in to change notification settings - Fork 109
Fix/rand interval #563
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
Fix/rand interval #563
Conversation
The first commit is old, sorry. But it is merged anyway. |
You guessed it. Since we now have Could you resolve the conflict first? So that we can get this merged into the master branch. |
Is it fine now? |
Co-authored-by: Jun Tian <find_my_way@foxmail.com>
…rning.jl into fix/rand_interval
* Fix dummy action for continuous action spaces * Fixed rand of an interval * dummy action for (half-)closed intervals * Update src/ReinforcementLearningEnvironments/src/base.jl Co-authored-by: Jun Tian <find_my_way@foxmail.com> * remove get_dummy_action for intervals * Fix kind fo typo Co-authored-by: Jun Tian <find_my_way@foxmail.com>
If at least one of the two endpoints are excluded from an interval, the rand function should not choose it.
Why the Union with Array{<:Interval}? I did remove it because it is similar with the functionality in Base:
What was the intention of it? I guess, the intention is to get a random action from each interval, not a random interval. This was not working. If this functionality is needed, I can add a commit for it.
Also, I did add two methods to choose one of the endpoints if it is not an open interval. This has better performance than rand, but does not restrict to using IntervalSets, because we always have a fallback to rand.