JuliaML / OpenAIGym.jl

OpenAI's Gym binding for Julia
Other
105 stars 20 forks source link

Episode iterator #2

Open tbreloff opened 8 years ago

tbreloff commented 8 years ago

Something like:

type Episode
    steps_remaining::Int
end
# iteration methods... decrement steps_remaining and get the state

env = Env(....)
for state in Episode(env, maxsteps = 100)
    # pick an action
    act(env, action)
end

note: Env should store the next action to apply so it can be applied (by calling step) in the iterator