Skip to content

Commit 407b2e2

Browse files
committed
change to while cond
1 parent b682921 commit 407b2e2

File tree

1 file changed

+1
-5
lines changed
  • src/ReinforcementLearningCore/src/core

1 file changed

+1
-5
lines changed

src/ReinforcementLearningCore/src/core/run.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function _run(policy::AbstractPolicy, env::AbstractEnv, stop_condition, hook::Ab
2424
policy(PRE_EPISODE_STAGE, env)
2525
hook(PRE_EPISODE_STAGE, policy, env)
2626

27-
while !is_terminated(env) # one episode
27+
while !reset_condition(policy, env) # one episode
2828
action = policy(env)
2929

3030
policy(PRE_ACT_STAGE, env, action)
@@ -35,10 +35,6 @@ function _run(policy::AbstractPolicy, env::AbstractEnv, stop_condition, hook::Ab
3535
policy(POST_ACT_STAGE, env)
3636
hook(POST_ACT_STAGE, policy, env)
3737

38-
if reset_condition(policy, env)
39-
is_stop = stop_condition(policy, env)
40-
break
41-
end
4238
if stop_condition(policy, env)
4339
is_stop = true
4440
break

0 commit comments

Comments
 (0)