Class RoutesConstraintProto
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.ortools.sat.RoutesConstraintProto
- All Implemented Interfaces:
RoutesConstraintProtoOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
@Generated
public final class RoutesConstraintProto
extends com.google.protobuf.GeneratedMessage
implements RoutesConstraintProtoOrBuilder
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. Note: Currently this constraint expects all the nodes in [0, num_nodes) to have at least one incident arc. The model will be considered invalid if it is not the case. You can add self-arc fixed to one to ignore some nodes if needed. 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 type
operations_research.sat.RoutesConstraintProto- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe "VRP" (Vehicle Routing Problem) constraint.static final classA set of linear expressions associated with the nodes.static interfaceNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>, BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongint64 capacity = 5;static RoutesConstraintProtointgetDemands(int index) DEPRECATED.intDEPRECATED.DEPRECATED.static final com.google.protobuf.Descriptors.DescriptorgetDimensions(int index) Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node.intExpressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node.Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node.getDimensionsOrBuilder(int index) Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node.Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node.intgetHeads(int index) repeated int32 heads = 2;intrepeated int32 heads = 2;repeated int32 heads = 2;intgetLiterals(int index) repeated int32 literals = 3;intrepeated int32 literals = 3;repeated int32 literals = 3;com.google.protobuf.Parser<RoutesConstraintProto> intintgetTails(int index) repeated int32 tails = 1;intrepeated int32 tails = 1;repeated int32 tails = 1;inthashCode()protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleannewBuilder(RoutesConstraintProto prototype) protected RoutesConstraintProto.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static RoutesConstraintProtoparseDelimitedFrom(InputStream input) static RoutesConstraintProtoparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProtoparseFrom(byte[] data) static RoutesConstraintProtoparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProtoparseFrom(com.google.protobuf.ByteString data) static RoutesConstraintProtoparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProtoparseFrom(com.google.protobuf.CodedInputStream input) static RoutesConstraintProtoparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProtoparseFrom(InputStream input) static RoutesConstraintProtoparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProtoparseFrom(ByteBuffer data) static RoutesConstraintProtoparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<RoutesConstraintProto> parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
TAILS_FIELD_NUMBER
public static final int TAILS_FIELD_NUMBER- See Also:
-
HEADS_FIELD_NUMBER
public static final int HEADS_FIELD_NUMBER- See Also:
-
LITERALS_FIELD_NUMBER
public static final int LITERALS_FIELD_NUMBER- See Also:
-
DEMANDS_FIELD_NUMBER
public static final int DEMANDS_FIELD_NUMBER- See Also:
-
CAPACITY_FIELD_NUMBER
public static final int CAPACITY_FIELD_NUMBER- See Also:
-
DIMENSIONS_FIELD_NUMBER
public static final int DIMENSIONS_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getTailsList
repeated int32 tails = 1;- Specified by:
getTailsListin interfaceRoutesConstraintProtoOrBuilder- Returns:
- A list containing the tails.
-
getTailsCount
public int getTailsCount()repeated int32 tails = 1;- Specified by:
getTailsCountin interfaceRoutesConstraintProtoOrBuilder- Returns:
- The count of tails.
-
getTails
public int getTails(int index) repeated int32 tails = 1;- Specified by:
getTailsin interfaceRoutesConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The tails at the given index.
-
getHeadsList
repeated int32 heads = 2;- Specified by:
getHeadsListin interfaceRoutesConstraintProtoOrBuilder- Returns:
- A list containing the heads.
-
getHeadsCount
public int getHeadsCount()repeated int32 heads = 2;- Specified by:
getHeadsCountin interfaceRoutesConstraintProtoOrBuilder- Returns:
- The count of heads.
-
getHeads
public int getHeads(int index) repeated int32 heads = 2;- Specified by:
getHeadsin interfaceRoutesConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The heads at the given index.
-
getLiteralsList
repeated int32 literals = 3;- Specified by:
getLiteralsListin interfaceRoutesConstraintProtoOrBuilder- Returns:
- A list containing the literals.
-
getLiteralsCount
public int getLiteralsCount()repeated int32 literals = 3;- Specified by:
getLiteralsCountin interfaceRoutesConstraintProtoOrBuilder- Returns:
- The count of literals.
-
getLiterals
public int getLiterals(int index) repeated int32 literals = 3;- Specified by:
getLiteralsin interfaceRoutesConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The literals at the given index.
-
getDemandsList
DEPRECATED. These fields are no longer used. The solver ignores them.
repeated int32 demands = 4;- Specified by:
getDemandsListin interfaceRoutesConstraintProtoOrBuilder- Returns:
- A list containing the demands.
-
getDemandsCount
public int getDemandsCount()DEPRECATED. These fields are no longer used. The solver ignores them.
repeated int32 demands = 4;- Specified by:
getDemandsCountin interfaceRoutesConstraintProtoOrBuilder- Returns:
- The count of demands.
-
getDemands
public int getDemands(int index) DEPRECATED. These fields are no longer used. The solver ignores them.
repeated int32 demands = 4;- Specified by:
getDemandsin interfaceRoutesConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The demands at the given index.
-
getCapacity
public long getCapacity()int64 capacity = 5;- Specified by:
getCapacityin interfaceRoutesConstraintProtoOrBuilder- Returns:
- The capacity.
-
getDimensionsList
Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).
repeated .operations_research.sat.RoutesConstraintProto.NodeExpressions dimensions = 6;- Specified by:
getDimensionsListin interfaceRoutesConstraintProtoOrBuilder
-
getDimensionsOrBuilderList
Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).
repeated .operations_research.sat.RoutesConstraintProto.NodeExpressions dimensions = 6;- Specified by:
getDimensionsOrBuilderListin interfaceRoutesConstraintProtoOrBuilder
-
getDimensionsCount
public int getDimensionsCount()Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).
repeated .operations_research.sat.RoutesConstraintProto.NodeExpressions dimensions = 6;- Specified by:
getDimensionsCountin interfaceRoutesConstraintProtoOrBuilder
-
getDimensions
Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).
repeated .operations_research.sat.RoutesConstraintProto.NodeExpressions dimensions = 6;- Specified by:
getDimensionsin interfaceRoutesConstraintProtoOrBuilder
-
getDimensionsOrBuilder
Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).
repeated .operations_research.sat.RoutesConstraintProto.NodeExpressions dimensions = 6;- Specified by:
getDimensionsOrBuilderin interfaceRoutesConstraintProtoOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static RoutesConstraintProto parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutesConstraintProto parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutesConstraintProto parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutesConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutesConstraintProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutesConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RoutesConstraintProto parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static RoutesConstraintProto parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static RoutesConstraintProto parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static RoutesConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RoutesConstraintProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-