Skip to content

feat!: Better reproducibility management of dynamic problems with SeededEnvironment#73

Open
BatyLeo wants to merge 6 commits into
mainfrom
seeded-env
Open

feat!: Better reproducibility management of dynamic problems with SeededEnvironment#73
BatyLeo wants to merge 6 commits into
mainfrom
seeded-env

Conversation

@BatyLeo

@BatyLeo BatyLeo commented Jun 12, 2026

Copy link
Copy Markdown
Member

Introduce a SeededEnvironment wrapper that is put around all concrete environments by generate_environments.
Concrete environments now shouldn't manage their own seed or RNG, the AbstractEnv interface is updated accordingly: reset! and step! now require an rng argument, the default get_seed method was removed, and the default RNG is switched from MersenneTwister to Xoshiro.

  • SeededEnvironment{E,R} (src/Utils/environment/seeded_environment.jl) wraps any AbstractEnvironment with a seed + rng.
  • reset_to_initial!(env) re-seed to the stored seed and resets.
  • rollout!(policy, env, rng) runs an episode from the current state, never resets.
  • generate_environments now returns Vector{SeededEnvironment}, seeding each env from an internal seed stream, same for generate_environment.
  • Now the user needs to only define build_environment instead of the old generate_environment.
  • evaluate_policy!(policy, env::SeededEnvironment; seed=nothing) resets to the initial seed (or a seed override) then rolls out.
  • All dynamic benchmarks (DVS, Maintenance, Assortment) were migrated to the new interface.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.38554% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/DynamicVehicleScheduling/environment.jl 75.00% 2 Missing ⚠️
...rc/DynamicVehicleScheduling/anticipative_solver.jl 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/Argmax2D/Argmax2D.jl 100.00% <ø> (ø)
...tualStochasticArgmax/ContextualStochasticArgmax.jl 94.28% <100.00%> (ø)
src/DecisionFocusedLearningBenchmarks.jl 100.00% <ø> (ø)
src/DynamicAssortment/DynamicAssortment.jl 100.00% <100.00%> (ø)
src/DynamicAssortment/environment.jl 100.00% <100.00%> (ø)
...namicVehicleScheduling/DynamicVehicleScheduling.jl 100.00% <100.00%> (ø)
src/DynamicVehicleScheduling/features.jl 93.89% <100.00%> (ø)
src/DynamicVehicleScheduling/scenario.jl 92.00% <ø> (ø)
src/Maintenance/Maintenance.jl 100.00% <100.00%> (ø)
src/Maintenance/environment.jl 100.00% <100.00%> (ø)
... and 11 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BatyLeo BatyLeo changed the title feat!: Better reproducibility managment of dynamic problems with SeededEnvironment feat!: Better reproducibility management of dynamic problems with SeededEnvironment Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant