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

Vector of Intervals error message for actions(env, s) #53

Open
lilanger opened this issue Jan 6, 2021 · 0 comments
Open

Vector of Intervals error message for actions(env, s) #53

lilanger opened this issue Jan 6, 2021 · 0 comments

Comments

@lilanger
Copy link
Contributor

lilanger commented Jan 6, 2021

I want to design a new environment with two continuous actions. While implementing the function actions(env, s) I run into an iteration error, shouldn't I be able to set a vector here?

actions(env::NewEnvironment, s) = IntervalSet([-min_action_a, -min_action_b], [max_action_a, max_action_b])

My error states:

Error showing value of type LearnBase.IntervalSet{Array{Float64,1}}:
ERROR: MethodError: no method matching iterate(::LearnBase.IntervalSet{Array{Float64,1}})
Closest candidates are:
  iterate(::ExponentialBackOff) at error.jl:252
  iterate(::ExponentialBackOff, ::Any) at error.jl:252
  iterate(::Base.AsyncGenerator, ::Base.AsyncGeneratorState) at asyncmap.jl:382
  ...
Stacktrace:
 [1] isempty(::LearnBase.IntervalSet{Array{Float64,1}}) at .\essentials.jl:737
 [2] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::LearnBase.IntervalSet{Array{Float64,1}}) at .\show.jl:149
 [3] display(::REPL.REPLDisplay, ::MIME{Symbol("text/plain")}, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:214
 [4] display(::REPL.REPLDisplay, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:218
 [5] display(::Any) at .\multimedia.jl:328
 [6] #invokelatest#1 at .\essentials.jl:710 [inlined]
 [7] invokelatest at .\essentials.jl:709 [inlined]
 [8] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:238
 [9] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:223
 [10] (::REPL.var"#do_respond#54"{Bool,Bool,Atom.var"#246#247",REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:822
 [11] #invokelatest#1 at .\essentials.jl:710 [inlined]
 [12] invokelatest at .\essentials.jl:709 [inlined]
 [13] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\LineEdit.jl:2355
 [14] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:1144
 [15] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at .\task.jl:356

It would be nice to access something like

ACTION_BOUND_HI = actions(env, env.state).hi
ACTION_BOUND_LO = actions(env, env.state).lo

and get Arrays of the upper and lower bounds for both actions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant