Skip to content

Commit

Permalink
update constraint_solver from google3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Oct 9, 2023
1 parent 524b33c commit 753a7ab
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 141 deletions.
2 changes: 1 addition & 1 deletion ortools/constraint_solver/python/pywrapcp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ class SumFilter(pywrapcp.IntVarLocalSearchFilter):
"""Filter to speed up LS computation."""

def __init__(self, int_vars):
pywrapcp.IntVarLocalSearchFilter.__init__(self, int_vars)
super.__init__(int_vars)
self.__sum = 0

def OnSynchronize(self, delta):
Expand Down
7 changes: 7 additions & 0 deletions ortools/constraint_solver/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,13 @@ class RoutingModel {
const std::vector<std::pair<int, int> >&
GetDeliveryIndexPairs(int64_t node_index) const;
// clang-format on
/// Returns whether the node is a pickup (resp. delivery).
bool IsPickup(int64_t node_index) const {
return !GetPickupIndexPairs(node_index).empty();
}
bool IsDelivery(int64_t node_index) const {
return !GetDeliveryIndexPairs(node_index).empty();
}

/// Sets the Pickup and delivery policy of all vehicles. It is equivalent to
/// calling SetPickupAndDeliveryPolicyOfVehicle on all vehicles.
Expand Down
Loading

0 comments on commit 753a7ab

Please sign in to comment.