Skip to content

Commit

Permalink
Add a warning in docstring of state (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
findmyway authored Jun 21, 2021
1 parent ebd9519 commit 7671d8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ReinforcementLearningBase/src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ The state can be of any type. However, most neural network based algorithms
assume an `AbstractArray` is returned. For environments with many different states
provided (inner state, information state, etc), users need to provide `style`
to declare which kind of state they want.
!!! warning
The state **may** be reused and be mutated at each step. Always remember to make a copy
if this is not what you expect.
"""
@multi_agent_env_api state(env::AbstractEnv) = state(env, DefaultStateStyle(env))
state(env::AbstractEnv, ss::AbstractStateStyle) = state(env, ss, current_player(env))
Expand Down

0 comments on commit 7671d8a

Please sign in to comment.