Skip to content

Commit

Permalink
Test: filtered infeasible service in initial route
Browse files Browse the repository at this point in the history
  • Loading branch information
senhalil committed Jun 24, 2020
1 parent 059a4e2 commit a9f63ec
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/wrapper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3046,4 +3046,28 @@ def test_detecting_unfeasible_services_can_not_take_too_long

assert_operator total_time, :<=, 14.0
end

def test_initial_route_with_infeasible_service
# service_1 is eliminated due to
# "Incompatibility between service skills and sticky vehicles"
# but it is referenced inside an initial route which should not cause an issue
problem = VRP.basic

problem[:vehicles] += [{
id: 'vehicle_1',
matrix_id: 'matrix_0',
start_point_id: 'point_0',
skills: [['vehicle_1']]
}]

problem[:services][0][:skills] = ['vehicle_1']
problem[:services][0][:sticky_vehicle_ids] = ['vehicle_0']

problem[:routes] = [{
vehicle_id: 'vehicle_0',
mission_ids: ['service_1', 'service_2', 'service_3']
}]

assert OptimizerWrapper.wrapper_vrp('demo', { services: { vrp: [:ortools] }}, TestHelper.create(problem), nil)
end
end

0 comments on commit a9f63ec

Please sign in to comment.