@@ -3,10 +3,10 @@ $TYPEDSIGNATURES
33
44Create the acyclic digraph associated with the given VSP `instance`.
55"""
6- function create_graph (instance:: VSPInstance )
6+ function create_graph (instance:: StaticInstance )
77 (; duration, start_time, service_time) = instance
88 # Initialize directed graph
9- nb_vertices = nb_locations (instance)
9+ nb_vertices = location_count (instance)
1010 graph = SimpleDiGraph (nb_vertices)
1111
1212 depot = 1 # depot is always index 1
@@ -42,8 +42,8 @@ $TYPEDSIGNATURES
4242
4343Create the acyclic digraph associated with the given VSP `state`.
4444"""
45- function create_graph (state:: VSPState )
46- return create_graph (state. instance )
45+ function create_graph (state:: DVSPState )
46+ return create_graph (state. state_instance )
4747end
4848
4949"""
@@ -82,9 +82,9 @@ $TYPEDSIGNATURES
8282Solve the Prize Collecting Vehicle Scheduling Problem defined by `instance` and prize vector `θ`.
8383"""
8484function prize_collecting_vsp (
85- θ:: AbstractVector ; instance:: VSPState , model_builder= highs_model, kwargs...
85+ θ:: AbstractVector ; instance:: DVSPState , model_builder= highs_model, kwargs...
8686)
87- (; duration) = instance. instance
87+ (; duration) = instance. state_instance
8888 graph = create_graph (instance)
8989
9090 model = model_builder ()
@@ -95,7 +95,7 @@ function prize_collecting_vsp(
9595
9696 @variable (model, y[i= 1 : nb_nodes, j= 1 : nb_nodes; has_edge (graph, i, j)] >= 0 )
9797
98- θ_ext = fill (0.0 , nb_locations (instance)) # no prize for must dispatch requests, only hard constraints
98+ θ_ext = fill (0.0 , location_count (instance)) # no prize for must dispatch requests, only hard constraints
9999 θ_ext[instance. is_postponable] .= θ
100100
101101 @objective (
131131function prize_collecting_vsp_Q (
132132 θ:: AbstractVector ,
133133 vals:: AbstractVector ;
134- instance:: VSPState ,
134+ instance:: DVSPState ,
135135 model_builder= highs_model,
136136 kwargs... ,
137137)
@@ -142,7 +142,7 @@ function prize_collecting_vsp_Q(
142142 nb_nodes = nv (graph)
143143 job_indices = 2 : (nb_nodes)
144144 @variable (model, y[i= 1 : nb_nodes, j= 1 : nb_nodes; has_edge (graph, i, j)] >= 0 )
145- θ_ext = fill (0.0 , nb_locations (instance. instance)) # no prize for must dispatch requests, only hard constraints
145+ θ_ext = fill (0.0 , location_count (instance. instance)) # no prize for must dispatch requests, only hard constraints
146146 θ_ext[instance. is_postponable] .= θ
147147 # v_ext = fill(0.0, nb_locations(instance.instance)) # no prize for must dispatch requests, only hard constraints
148148 # v_ext[instance.is_postponable] .= vals
176176function my_objective_value (θ, routes; instance)
177177 (; duration) = instance. instance
178178 total = 0.0
179- θ_ext = fill (0.0 , nb_locations (instance))
179+ θ_ext = fill (0.0 , location_count (instance))
180180 θ_ext[instance. is_postponable] .= θ
181181 for route in routes
182182 for (u, v) in partition (vcat (1 , route), 2 , 1 )
189189function _objective_value (θ, routes; instance)
190190 (; duration) = instance. instance
191191 total = 0.0
192- θ_ext = fill (0.0 , nb_locations (instance))
192+ θ_ext = fill (0.0 , location_count (instance))
193193 θ_ext[instance. is_postponable] .= θ
194194 mapping = cumsum (instance. is_postponable)
195195 g = falses (length (θ))
0 commit comments