-
Notifications
You must be signed in to change notification settings - Fork 0
Interface overhaul #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
BatyLeo
wants to merge
15
commits into
main
Choose a base branch
from
dynamic-interface-poc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to increase the expressivity of the benchmarks interface, to allow for easy implmentations of stochastic and dynamic benchmark problems, as well as their associated learning algorithms.
New abstract types
For this, we define two new sub abstract types of
AbstractBenchmark
:This assumes any dynamic problem is also stochastic.
New interface methods
For
AbstractBenchmark
Implementing the full
generate_dataset
method can in practice be a bit tedious and verbose for no reason. While keeping the option to implement it for some applications where it makes sense, we propose an alternative where the user only needs to implement agenerate_sample
method that outputs a singleDataSample
instead of a full dataset:For
AbstractStochasticBenchmark
We need two new methods, one for generating scenarios, and one for computing anticipative decisions:
Note that in both cases this only applies to problems with exogenous noise.
generate_scenario_generator
should output a callable that takes as input an instance, along with optional seed and rng as kwargs, and outputs a scenario, which can be a custom type depending on the benchmark.generate_anticipative_solver
should output a callable that takes as input an instance and a scenario (generated by the scenario generator), and outputs the corresponding anticipative decision.For
AbstractDynamicBenchmark
For dynamic problems, we mainly need to instantiate environments from instances. For this, we define the
generate_environment
andgenerate_environments
methods. Similarly togenerate_sample
andgenerate_datasets
, one may only need to implement the first one, that takes as inpout an instance and outputs an environment. If needed, this environment type can be defined as a subtype ofAbstractEnv
fromCommonRLInterface.jl
for better integration and compatibility in the ecosystem.Additionally, we may want to apply RL algorithms to non-dynamic benchmarks, by considering them as dynamic problems with time horizon of length 1. We therefore propose a
StaticEnv <: AbstractEnv
wrapper around static instances for this.New Benchmark problems
Currently, the Dynamic vehicle scheduling problem is implemented with thuis interface.
We plan to additionally implement the Dynamic VRP as well as the dynamic Inventory routing.
Points I'm unsure about
TODO: