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

Commit a9fcedc

Browse files
authored
Split the logic of run into two steps to allow injecting checkers (#143)
* split the logic of run into two steps
1 parent cf3c991 commit a9fcedc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/run.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ export expected_policy_values
22

33
import Base: run
44

5-
run(agent, env::AbstractEnv, args...) =
6-
run(DynamicStyle(env), NumAgentStyle(env), agent, env, args...)
5+
run(agent, env::AbstractEnv, args...) = _run(agent, env, args...)
76

8-
function run(
7+
_run(agent, env, args...) = _run(DynamicStyle(env), NumAgentStyle(env), agent, env, args...)
8+
9+
function _run(
910
::Sequential,
1011
::SingleAgent,
1112
agent::AbstractAgent,
@@ -45,7 +46,7 @@ function run(
4546
hook
4647
end
4748

48-
function run(
49+
function _run(
4950
::Sequential,
5051
::SingleAgent,
5152
agent::AbstractAgent,
@@ -71,7 +72,7 @@ function run(
7172
hook
7273
end
7374

74-
function run(
75+
function _run(
7576
::Sequential,
7677
::MultiAgent,
7778
agents::Tuple{Vararg{<:AbstractAgent}},

0 commit comments

Comments
 (0)