Skip to content

Commit cf031b3

Browse files
committed
Clarify anticipative solver interface for dynamic benchmarks
1 parent 8b1fe30 commit cf031b3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/src/custom_benchmarks.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ generate_baseline_policies(bench::MyDynamicBenchmark)
149149
# Each callable performs a full episode rollout and returns the trajectory.
150150
```
151151

152+
### Anticipative solver (optional)
153+
154+
```julia
155+
generate_anticipative_solver(bench::MyDynamicBenchmark)
156+
# Returns a callable: (env; reset_env=true, kwargs...) -> Vector{DataSample}
157+
# reset_env=true → reset environment before solving
158+
# reset_env=false → solve from current state
159+
```
160+
152161
### Optional visualization methods
153162

154163
```julia

src/Utils/interface/dynamic_benchmark.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ of decisions) as in [`AbstractStochasticBenchmark`](@ref).
1818
can be drawn independently.
1919
- [`generate_baseline_policies`](@ref)`(bench)`: returns named baseline callables of
2020
signature `(env) -> Vector{DataSample}` (full trajectory rollout).
21+
- [`generate_anticipative_solver`](@ref)`(bench)`: returns a callable
22+
`(env; reset_env=true, kwargs...) -> Vector{DataSample}` that runs the anticipative solver over a full episode. `reset_env=true` resets the environment
23+
before solving. `reset_env=false` starts from the current state.
2124
- [`generate_dataset`](@ref)`(bench, environments; target_policy, ...)`: generates
2225
training-ready [`DataSample`](@ref)s by calling `target_policy(env)` for each environment.
2326
Requires `target_policy` as a mandatory keyword argument.

0 commit comments

Comments
 (0)