@@ -165,25 +165,6 @@ function anticipative_solver(
165165 N = N + M
166166 index += 1
167167 end
168- # epoch_indices = Vector{Int}[] # store global indices present at each epoch
169- # N = 1 # current last index known in global indexing (= depot)
170- # index = 1
171- # indices = [1]
172- # for epoch in 1:last_epoch(env)
173- # M = length(scenario.indices[epoch]) # number of new customers in epoch
174- # indices = vcat(indices, (N + 1):(N + M)) # add global indices of customers in epoch
175- # push!(epoch_indices, copy(indices))
176- # N = N + M
177- # if epoch in T #
178- # dispatched = vcat(epoch_routes[index]...)
179- # index += 1
180- # indices = setdiff(indices, dispatched)
181- # end
182- # end
183-
184- # indices = vcat(1, scenario.indices...)
185- # start_time = vcat(0.0, scenario.start_time...)
186- # service_time = vcat(0.0, scenario.service_time...)
187168
188169 dataset = map (enumerate (T)) do (i, epoch)
189170 routes = epoch_routes[i]
@@ -215,14 +196,15 @@ function anticipative_solver(
215196 epoch_duration = env. instance. epoch_duration
216197 Δ_dispatch = env. instance. Δ_dispatch
217198 planning_start_time = (epoch - 1 ) * epoch_duration + Δ_dispatch
218- if epoch == last_epoch
199+ if epoch == end_epoch
219200 # If we are in the last epoch, all requests must be dispatched
220201 is_must_dispatch[2 : end ] .= true
221202 else
222203 is_must_dispatch[2 : end ] .=
223204 planning_start_time .+ epoch_duration .+ @view (new_duration[1 , 2 : end ]) .> new_start_time[2 : end ]
224205 end
225206 is_postponable[2 : end ] .= .! is_must_dispatch[2 : end ]
207+ # TODO : avoid code duplication with add_new_customers!
226208
227209 state = DVSPState (;
228210 state_instance= static_instance,
0 commit comments