-
Notifications
You must be signed in to change notification settings - Fork 9
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 SingleRoomUndirected & SingleRoomDirected #153
Merged
Sid-Bhatia-0
merged 16 commits into
JuliaReinforcementLearning:master
from
Sid-Bhatia-0:single_room
Jul 1, 2021
Merged
add SingleRoomUndirected & SingleRoomDirected #153
Sid-Bhatia-0
merged 16 commits into
JuliaReinforcementLearning:master
from
Sid-Bhatia-0:single_room
Jul 1, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
==========================================
- Coverage 78.21% 75.89% -2.33%
==========================================
Files 21 25 +4
Lines 2226 2468 +242
==========================================
+ Hits 1741 1873 +132
- Misses 485 595 +110
Continue to review full report at Codecov.
|
cool, glad we reach an agreement on it ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@findmyway I have rethought the design of this package to achieve our various goals, including decoupling with respect to the
RLBase
API. Here's what I think:RL environments are games first before they are environments. For
GridWorlds.jl
we don't need to create yet another powerful RL API likeRLBase
, we just need to be able to supportRLBase
(orCommonRLInterface
or anything else for that matter) on top of a lightweight API that only covers running the core logic of all the grid-world games.It turns out that all the game logic nicely fits into two methods -
reset!
andact!
. Other than the core logic, theGridWorlds.jl
API doesn't need to explicitly provide methods to get the state, for example, because states are only defined in the context of RL, and the ability to get a state via a method is not part of the core logic of a grid world game. It just needs to be run the game logic, and all the RL related methods will be implemented by the concerned RL API likeRLBase
(we will provide the implementations forRLBase
, just that they will be decoupled from the core game logic, which will be governed by theGridWorlds.jl
specific methodsGW.reset!
andGW.act!
).In this way, we can later support any API apart from
RLBase
, likeCommonRLInterface
as well.For this, I am adding a new abstract type
AbstractGridWorldGame <: Any
instead of the currentAbstractGridWorld <: RLBase.AbstractEnv
. All theRLBase
API methods for all the games will live in a separate module calledRLBaseGridWorldModule
.On separation of environments, each grid-world game will be in a separate module. For example,
SingleRoomUndirected
is present inSingleRoomUndirectedModule
andSingleRoomDirected
is inSingleRoomDirectedModule
. This allows for each environment to define its ownconst
s that are isolated from other environments.Another interesting thing to notice is that directed and undirected environments differ only in the way navigation occurs, and the rest of the logic is the same for the most part (in the same type of environment like
SingleRoom
). Also, undirected navigation is the more primitive/simpler one as it doesn't need to keep track of direction. So directed environments can reuse significant functionality from undirected environments. An example isSingleRoomUndirected
andSingleRoomDirected
as in this PR.