Skip to content

Commit

Permalink
reject when unknow vehicle in relation
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsecadeline committed Feb 11, 2021
1 parent ee550da commit 189a823
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions models/vrp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,12 @@ def check_relations
)
end

if relation_vehicles.include?(nil)
raise OptimizerWrapper::DiscordantProblemError.new(
'Unknown vehicle in relation'
)
end

check_vehicle_trips_stores_consistency(relation_vehicles)
check_vehicle_trips_timewindows_consistency(relation_vehicles)
check_vehicle_trips_force_start_consistency(relation_vehicles)
Expand Down

0 comments on commit 189a823

Please sign in to comment.