Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
add RandomStartPolicy & restrict QBasedPolicy to return index of acti…
Browse files Browse the repository at this point in the history
…on (#189)
  • Loading branch information
findmyway authored Dec 19, 2020
1 parent 135e691 commit 0cc7c7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/policies/policies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include("base.jl")
include("agents/agents.jl")
include("q_based_policies/q_based_policies.jl")
include("random_policy.jl")
include("random_start_policy.jl")
5 changes: 2 additions & 3 deletions src/policies/q_based_policies/q_based_policy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ end
Flux.functor(x::QBasedPolicy) = (learner = x.learner,), y -> @set x.learner = y.learner

::QBasedPolicy)(env) = π(env, ActionStyle(env))
::QBasedPolicy)(env, ::MinimalActionSet) = action_space(env)[π.explorer.learner(env))]
::QBasedPolicy)(env, ::FullActionSet) =
action_space(env)[π.explorer.learner(env), legal_action_space_mask(env))]
::QBasedPolicy)(env, ::MinimalActionSet) = π.explorer.learner(env))
::QBasedPolicy)(env, ::FullActionSet) = π.explorer.learner(env), legal_action_space_mask(env))

RLBase.prob(p::QBasedPolicy, env) = prob(p, env, ActionStyle(env))
RLBase.prob(p::QBasedPolicy, env, ::MinimalActionSet) =
Expand Down

2 comments on commit 0cc7c7e

@findmyway
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/26663

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.1 -m "<description of version>" 0cc7c7e58542fee55e97a9ad328907ab92ff47b3
git push origin v0.6.1

Please sign in to comment.