Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ConstrainedShortestPaths = "b3798467-87dc-4d99-943d-35a1bd39e395"
DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Expand Down Expand Up @@ -40,6 +41,7 @@ ConstrainedShortestPaths = "0.6.0"
DataDeps = "0.7"
Distributions = "0.25"
DocStringExtensions = "0.9"
FileIO = "1.17.0"
Flux = "0.14, 0.15, 0.16"
Graphs = "1.11"
HiGHS = "1.9"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
[![Coverage](https://codecov.io/gh/JuliaDecisionFocusedLearning/DecisionFocusedLearningBenchmarks.jl/branch/main/graph/badge.svg)](https://app.codecov.io/gh/JuliaDecisionFocusedLearning/DecisionFocusedLearningBenchmarks.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/JuliaDiff/BlueStyle)

!!! warning
This package is currently under active development. The API may change in future releases.
Please refer to the [documentation](https://JuliaDecisionFocusedLearning.github.io/DecisionFocusedLearningBenchmarks.jl/stable/) for the latest updates.

## What is Decision-Focused Learning?

Decision-focused learning (DFL) is a paradigm that integrates machine learning prediction with combinatorial optimization to make better decisions under uncertainty. Unlike traditional "predict-then-optimize" approaches that optimize prediction accuracy independently of downstream decision quality, DFL directly optimizes end-to-end decision performance.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/benchmark_interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ The package defines a hierarchy of three abstract types:

```
AbstractBenchmark
── AbstractStochasticBenchmark{exogenous}
── AbstractStochasticBenchmark{exogenous}
└── AbstractDynamicBenchmark{exogenous}
```

- **`AbstractBenchmark`**: static, single-stage optimization problems
- **`AbstractStochasticBenchmark{exogenous}`**: stochastic, single stage optimization problems
**`AbstractDynamicBenchmark{exogenous}`**: multi-stage sequential decision problems
- **`AbstractDynamicBenchmark{exogenous}`**: multi-stage sequential decision-making problems

The `{exogenous}` type parameter indicates whether uncertainty distribution comes from external sources (`true`) or is influenced by decisions (`false`), which affects available methods.

Expand Down
2 changes: 1 addition & 1 deletion src/DynamicVehicleScheduling/DynamicVehicleScheduling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using IterTools: partition
using JSON
using JuMP
using Plots: plot, plot!, scatter!, @animate, Plots, gif
using Printf: @printf
using Printf: @printf, @sprintf
using Random: Random, AbstractRNG, MersenneTwister, seed!, randperm
using Requires: @require
using Statistics: mean, quantile
Expand Down
5 changes: 4 additions & 1 deletion src/DynamicVehicleScheduling/anticipative_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function anticipative_solver(
)
if reset_env
reset!(env; reset_rng=true, seed)
scenario = env.scenario
end

@assert !is_terminated(env)
Expand Down Expand Up @@ -213,13 +214,15 @@ function anticipative_solver(
current_epoch=epoch,
)

reward = -cost(state, decode_bitmatrix_to_routes(y_true))

x = if two_dimensional_features
compute_2D_features(state, env.instance)
else
compute_features(state, env.instance)
end

return DataSample(; instance=state, y_true, x)
return DataSample(; instance=(; state, reward), y_true, x)
end

return obj, dataset
Expand Down
Loading