Java Reference
Java Reference
Detailed Description
The "VRP" (Vehicle Routing Problem) constraint. The direct graph where arc #i (from tails[i] to head[i]) is present iff literals[i] is true must satisfy this set of properties:
- #incoming arcs == 1 except for node 0.
- #outgoing arcs == 1 except for node 0.
- for node zero, #incoming arcs == #outgoing arcs.
- There are no duplicate arcs.
- Self-arcs are allowed except for node 0.
- There is no cycle in this graph, except through node 0. TODO(user): It is probably possible to generalize this constraint to a no-cycle in a general graph, or a no-cycle with sum incoming <= 1 and sum outgoing <= 1 (more efficient implementation). On the other hand, having this specific constraint allow us to add specific "cuts" to a VRP problem.
Protobuf typeoperations_research.sat.RoutesConstraintProto
Definition at line 630 of file RoutesConstraintProto.java.
Public Member Functions | |
| .lang.Override Builder | clear () |
| .lang.Override com.google.protobuf.Descriptors.Descriptor | getDescriptorForType () |
| .lang.Override com.google.ortools.sat.RoutesConstraintProto | getDefaultInstanceForType () |
| .lang.Override com.google.ortools.sat.RoutesConstraintProto | build () |
| .lang.Override com.google.ortools.sat.RoutesConstraintProto | buildPartial () |
| .lang.Override Builder | clone () |
| .lang.Override Builder | setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) |
| .lang.Override Builder | clearField (com.google.protobuf.Descriptors.FieldDescriptor field) |
| .lang.Override Builder | clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof) |
| .lang.Override Builder | setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) |
| .lang.Override Builder | addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) |
| .lang.Override Builder | mergeFrom (com.google.protobuf.Message other) |
| Builder | mergeFrom (com.google.ortools.sat.RoutesConstraintProto other) |
| .lang.Override final boolean | isInitialized () |
| .lang.Override Builder | mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| java.util.List< java.lang.Integer > | getTailsList () |
repeated int32 tails = 1; More... | |
| int | getTailsCount () |
repeated int32 tails = 1; More... | |
| int | getTails (int index) |
repeated int32 tails = 1; More... | |
| Builder | setTails (int index, int value) |
repeated int32 tails = 1; More... | |
| Builder | addTails (int value) |
repeated int32 tails = 1; More... | |
| Builder | addAllTails (java.lang.Iterable<? extends java.lang.Integer > values) |
repeated int32 tails = 1; More... | |
| Builder | clearTails () |
repeated int32 tails = 1; More... | |
| java.util.List< java.lang.Integer > | getHeadsList () |
repeated int32 heads = 2; More... | |
| int | getHeadsCount () |
repeated int32 heads = 2; More... | |
| int | getHeads (int index) |
repeated int32 heads = 2; More... | |
| Builder | setHeads (int index, int value) |
repeated int32 heads = 2; More... | |
| Builder | addHeads (int value) |
repeated int32 heads = 2; More... | |
| Builder | addAllHeads (java.lang.Iterable<? extends java.lang.Integer > values) |
repeated int32 heads = 2; More... | |
| Builder | clearHeads () |
repeated int32 heads = 2; More... | |
| java.util.List< java.lang.Integer > | getLiteralsList () |
repeated int32 literals = 3; More... | |
| int | getLiteralsCount () |
repeated int32 literals = 3; More... | |
| int | getLiterals (int index) |
repeated int32 literals = 3; More... | |
| Builder | setLiterals (int index, int value) |
repeated int32 literals = 3; More... | |
| Builder | addLiterals (int value) |
repeated int32 literals = 3; More... | |
| Builder | addAllLiterals (java.lang.Iterable<? extends java.lang.Integer > values) |
repeated int32 literals = 3; More... | |
| Builder | clearLiterals () |
repeated int32 literals = 3; More... | |
| java.util.List< java.lang.Integer > | getDemandsList () |
| int | getDemandsCount () |
| int | getDemands (int index) |
| Builder | setDemands (int index, int value) |
| Builder | addDemands (int value) |
| Builder | addAllDemands (java.lang.Iterable<? extends java.lang.Integer > values) |
| Builder | clearDemands () |
| .lang.Override long | getCapacity () |
int64 capacity = 5; More... | |
| Builder | setCapacity (long value) |
int64 capacity = 5; More... | |
| Builder | clearCapacity () |
int64 capacity = 5; More... | |
| .lang.Override final Builder | setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields) |
| .lang.Override final Builder | mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields) |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
Protected Member Functions | |
| .lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable | internalGetFieldAccessorTable () |
Member Function Documentation
◆ addAllDemands()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Parameters
-
values The demands to add.
- Returns
- This builder for chaining.
Definition at line 1177 of file RoutesConstraintProto.java.
◆ addAllHeads()
|
inline |
repeated int32 heads = 2;
- Parameters
-
values The heads to add.
- Returns
- This builder for chaining.
Definition at line 983 of file RoutesConstraintProto.java.
◆ addAllLiterals()
|
inline |
repeated int32 literals = 3;
- Parameters
-
values The literals to add.
- Returns
- This builder for chaining.
Definition at line 1062 of file RoutesConstraintProto.java.
◆ addAllTails()
|
inline |
repeated int32 tails = 1;
- Parameters
-
values The tails to add.
- Returns
- This builder for chaining.
Definition at line 904 of file RoutesConstraintProto.java.
◆ addDemands()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Parameters
-
value The demands to add.
- Returns
- This builder for chaining.
Definition at line 1160 of file RoutesConstraintProto.java.
◆ addHeads()
|
inline |
repeated int32 heads = 2;
- Parameters
-
value The heads to add.
- Returns
- This builder for chaining.
Definition at line 972 of file RoutesConstraintProto.java.
◆ addLiterals()
|
inline |
repeated int32 literals = 3;
- Parameters
-
value The literals to add.
- Returns
- This builder for chaining.
Definition at line 1051 of file RoutesConstraintProto.java.
◆ addRepeatedField()
|
inline |
Definition at line 754 of file RoutesConstraintProto.java.
◆ addTails()
|
inline |
repeated int32 tails = 1;
- Parameters
-
value The tails to add.
- Returns
- This builder for chaining.
Definition at line 893 of file RoutesConstraintProto.java.
◆ build()
|
inline |
Definition at line 690 of file RoutesConstraintProto.java.
◆ buildPartial()
|
inline |
Definition at line 699 of file RoutesConstraintProto.java.
◆ clear()
|
inline |
Definition at line 663 of file RoutesConstraintProto.java.
◆ clearCapacity()
|
inline |
int64 capacity = 5;
- Returns
- This builder for chaining.
Definition at line 1226 of file RoutesConstraintProto.java.
◆ clearDemands()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Returns
- This builder for chaining.
Definition at line 1195 of file RoutesConstraintProto.java.
◆ clearField()
|
inline |
Definition at line 738 of file RoutesConstraintProto.java.
◆ clearHeads()
|
inline |
repeated int32 heads = 2;
- Returns
- This builder for chaining.
Definition at line 995 of file RoutesConstraintProto.java.
◆ clearLiterals()
|
inline |
repeated int32 literals = 3;
- Returns
- This builder for chaining.
Definition at line 1074 of file RoutesConstraintProto.java.
◆ clearOneof()
|
inline |
Definition at line 743 of file RoutesConstraintProto.java.
◆ clearTails()
|
inline |
repeated int32 tails = 1;
- Returns
- This builder for chaining.
Definition at line 916 of file RoutesConstraintProto.java.
◆ clone()
|
inline |
Definition at line 728 of file RoutesConstraintProto.java.
◆ getCapacity()
|
inline |
int64 capacity = 5;
- Returns
- The capacity.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1208 of file RoutesConstraintProto.java.
◆ getDefaultInstanceForType()
|
inline |
Definition at line 685 of file RoutesConstraintProto.java.
◆ getDemands()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Parameters
-
index The index of the element to return.
- Returns
- The demands at the given index.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1127 of file RoutesConstraintProto.java.
◆ getDemandsCount()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Returns
- The count of demands.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1113 of file RoutesConstraintProto.java.
◆ getDemandsList()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Returns
- A list containing the demands.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1099 of file RoutesConstraintProto.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 635 of file RoutesConstraintProto.java.
◆ getDescriptorForType()
|
inline |
Definition at line 680 of file RoutesConstraintProto.java.
◆ getHeads()
|
inline |
repeated int32 heads = 2;
- Parameters
-
index The index of the element to return.
- Returns
- The heads at the given index.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 951 of file RoutesConstraintProto.java.
◆ getHeadsCount()
|
inline |
repeated int32 heads = 2;
- Returns
- The count of heads.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 943 of file RoutesConstraintProto.java.
◆ getHeadsList()
|
inline |
repeated int32 heads = 2;
- Returns
- A list containing the heads.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 935 of file RoutesConstraintProto.java.
◆ getLiterals()
|
inline |
repeated int32 literals = 3;
- Parameters
-
index The index of the element to return.
- Returns
- The literals at the given index.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1030 of file RoutesConstraintProto.java.
◆ getLiteralsCount()
|
inline |
repeated int32 literals = 3;
- Returns
- The count of literals.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1022 of file RoutesConstraintProto.java.
◆ getLiteralsList()
|
inline |
repeated int32 literals = 3;
- Returns
- A list containing the literals.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 1014 of file RoutesConstraintProto.java.
◆ getTails()
|
inline |
repeated int32 tails = 1;
- Parameters
-
index The index of the element to return.
- Returns
- The tails at the given index.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 872 of file RoutesConstraintProto.java.
◆ getTailsCount()
|
inline |
repeated int32 tails = 1;
- Returns
- The count of tails.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 864 of file RoutesConstraintProto.java.
◆ getTailsList()
|
inline |
repeated int32 tails = 1;
- Returns
- A list containing the tails.
Implements RoutesConstraintProtoOrBuilder.
Definition at line 856 of file RoutesConstraintProto.java.
◆ internalGetFieldAccessorTable()
|
inlineprotected |
Definition at line 641 of file RoutesConstraintProto.java.
◆ isInitialized()
|
inline |
Definition at line 820 of file RoutesConstraintProto.java.
◆ mergeFrom() [1/3]
|
inline |
Definition at line 769 of file RoutesConstraintProto.java.
◆ mergeFrom() [2/3]
|
inline |
Definition at line 825 of file RoutesConstraintProto.java.
◆ mergeFrom() [3/3]
|
inline |
Definition at line 760 of file RoutesConstraintProto.java.
◆ mergeUnknownFields()
|
inline |
Definition at line 1239 of file RoutesConstraintProto.java.
◆ setCapacity()
|
inline |
int64 capacity = 5;
- Parameters
-
value The capacity to set.
- Returns
- This builder for chaining.
Definition at line 1216 of file RoutesConstraintProto.java.
◆ setDemands()
|
inline |
Experimental. The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.
repeated int32 demands = 4;
- Parameters
-
index The index to set the value at. value The demands to set.
- Returns
- This builder for chaining.
Definition at line 1142 of file RoutesConstraintProto.java.
◆ setField()
|
inline |
Definition at line 732 of file RoutesConstraintProto.java.
◆ setHeads()
|
inline |
repeated int32 heads = 2;
- Parameters
-
index The index to set the value at. value The heads to set.
- Returns
- This builder for chaining.
Definition at line 960 of file RoutesConstraintProto.java.
◆ setLiterals()
|
inline |
repeated int32 literals = 3;
- Parameters
-
index The index to set the value at. value The literals to set.
- Returns
- This builder for chaining.
Definition at line 1039 of file RoutesConstraintProto.java.
◆ setRepeatedField()
|
inline |
Definition at line 748 of file RoutesConstraintProto.java.
◆ setTails()
|
inline |
repeated int32 tails = 1;
- Parameters
-
index The index to set the value at. value The tails to set.
- Returns
- This builder for chaining.
Definition at line 881 of file RoutesConstraintProto.java.
◆ setUnknownFields()
|
inline |
Definition at line 1233 of file RoutesConstraintProto.java.
The documentation for this class was generated from the following file: