|
3 | 3 | using DecisionFocusedLearningBenchmarks.StochasticVehicleScheduling |
4 | 4 | using Graphs |
5 | 5 | using Plots |
| 6 | + using StableRNGs: StableRNG |
6 | 7 |
|
7 | 8 | b = StochasticVehicleSchedulingBenchmark(; nb_tasks=25, nb_scenarios=10) |
8 | 9 |
|
9 | 10 | N = 5 |
10 | | - dataset = generate_dataset(b, N; seed=0) |
11 | | - mip_dataset = generate_dataset(b, N; seed=0, algorithm=compact_mip) |
12 | | - mipl_dataset = generate_dataset(b, N; seed=0, algorithm=compact_linearized_mip) |
13 | | - local_search_dataset = generate_dataset(b, N; seed=0, algorithm=local_search) |
14 | | - deterministic_dataset = generate_dataset(b, N; seed=0, algorithm=deterministic_mip) |
| 11 | + dataset = generate_dataset(b, N; seed=0, rng=StableRNG(0)) |
| 12 | + mip_dataset = generate_dataset(b, N; seed=0, rng=StableRNG(0), algorithm=compact_mip) |
| 13 | + mipl_dataset = generate_dataset( |
| 14 | + b, N; seed=0, rng=StableRNG(0), algorithm=compact_linearized_mip |
| 15 | + ) |
| 16 | + local_search_dataset = generate_dataset( |
| 17 | + b, N; seed=0, rng=StableRNG(0), algorithm=local_search |
| 18 | + ) |
| 19 | + deterministic_dataset = generate_dataset( |
| 20 | + b, N; seed=0, rng=StableRNG(0), algorithm=deterministic_mip |
| 21 | + ) |
15 | 22 | @test length(dataset) == N |
16 | 23 |
|
17 | 24 | figure_1 = plot_instance(b, dataset[1]) |
|
28 | 35 | gap_local_search = compute_gap(b, local_search_dataset, model, maximizer) |
29 | 36 | gap_deterministic = compute_gap(b, deterministic_dataset, model, maximizer) |
30 | 37 |
|
31 | | - @test gap >= 0 && gap_mip >= 0 && gap_mipl >= 0 && gap_local_search >= 0 |
32 | 38 | @test gap_mip ≈ gap_mipl rtol = 1e-2 |
33 | 39 | @test gap_mip >= gap_local_search |
34 | 40 | @test gap_mip >= gap |
|
0 commit comments