Skip to content

Commit 48ae9e3

Browse files
committed
plotting functions
1 parent 3790c59 commit 48ae9e3

File tree

3 files changed

+548
-4
lines changed

3 files changed

+548
-4
lines changed

src/DynamicVehicleScheduling/DynamicVehicleScheduling.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using InferOpt: LinearMaximizer
1212
using IterTools: partition
1313
using JSON
1414
using JuMP
15-
using Plots: plot, plot!, scatter!
15+
using Plots: plot, plot!, scatter!, @animate, Plots, gif
1616
using Printf: @printf
1717
using Random: Random, AbstractRNG, MersenneTwister, seed!, randperm
1818
using Requires: @require

src/DynamicVehicleScheduling/anticipative_solver.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function anticipative_solver(
5656
start_epoch = current_epoch(env)
5757
end_epoch = min(last_epoch(env), start_epoch + nb_epochs - 1)
5858
T = start_epoch:end_epoch
59+
@info T
5960

6061
request_epoch = [0]
6162
for t in T
@@ -69,11 +70,11 @@ function anticipative_solver(
6970
(; epoch_duration, Δ_dispatch) = env.instance
7071

7172
model = model_builder()
72-
set_silent(model)
73+
# set_silent(model)
7374

7475
nb_nodes = length(customer_index)
7576
job_indices = 2:nb_nodes
76-
epoch_indices = T#first_epoch:last_epoch
77+
epoch_indices = T
7778

7879
@variable(model, y[i = 1:nb_nodes, j = 1:nb_nodes, t = epoch_indices]; binary=true)
7980

@@ -128,6 +129,11 @@ function anticipative_solver(
128129

129130
optimize!(model)
130131

132+
@info "Objective value: $(JuMP.objective_value(model))"
133+
@info termination_status(model)
134+
y_val = value.(y)
135+
@info sum(y_val[j, 2, t] for j in 1:nb_nodes, t in epoch_indices)
136+
131137
obj = JuMP.objective_value(model)
132138
epoch_routes = retrieve_routes_anticipative(
133139
value.(y), env, customer_index, epoch_indices

0 commit comments

Comments
 (0)