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 class
The "VRP" (Vehicle Routing Problem) constraint.static final class
A set of linear expressions associated with the nodes.static interface
Nested 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.BuilderParent
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFields
Fields inherited from class com.google.protobuf.AbstractMessage
memoizedSize
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
int64 capacity = 5;
static RoutesConstraintProto
int
getDemands
(int index) DEPRECATED.int
DEPRECATED.DEPRECATED.static final com.google.protobuf.Descriptors.Descriptor
getDimensions
(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.int
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.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.int
getHeads
(int index) repeated int32 heads = 2;
int
repeated int32 heads = 2;
repeated int32 heads = 2;
int
getLiterals
(int index) repeated int32 literals = 3;
int
repeated int32 literals = 3;
repeated int32 literals = 3;
com.google.protobuf.Parser
<RoutesConstraintProto> int
int
getTails
(int index) repeated int32 tails = 1;
int
repeated int32 tails = 1;
repeated int32 tails = 1;
int
hashCode()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
newBuilder
(RoutesConstraintProto prototype) protected RoutesConstraintProto.Builder
newBuilderForType
(com.google.protobuf.AbstractMessage.BuilderParent parent) static RoutesConstraintProto
parseDelimitedFrom
(InputStream input) static RoutesConstraintProto
parseDelimitedFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProto
parseFrom
(byte[] data) static RoutesConstraintProto
parseFrom
(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProto
parseFrom
(com.google.protobuf.ByteString data) static RoutesConstraintProto
parseFrom
(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProto
parseFrom
(com.google.protobuf.CodedInputStream input) static RoutesConstraintProto
parseFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProto
parseFrom
(InputStream input) static RoutesConstraintProto
parseFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutesConstraintProto
parseFrom
(ByteBuffer data) static RoutesConstraintProto
parseFrom
(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser
<RoutesConstraintProto> parser()
void
writeTo
(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, writeStringNoTag
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
Methods 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:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage
-
getTailsList
repeated int32 tails = 1;
- Specified by:
getTailsList
in interfaceRoutesConstraintProtoOrBuilder
- Returns:
- A list containing the tails.
-
getTailsCount
public int getTailsCount()repeated int32 tails = 1;
- Specified by:
getTailsCount
in interfaceRoutesConstraintProtoOrBuilder
- Returns:
- The count of tails.
-
getTails
public int getTails(int index) repeated int32 tails = 1;
- Specified by:
getTails
in interfaceRoutesConstraintProtoOrBuilder
- Parameters:
index
- The index of the element to return.- Returns:
- The tails at the given index.
-
getHeadsList
repeated int32 heads = 2;
- Specified by:
getHeadsList
in interfaceRoutesConstraintProtoOrBuilder
- Returns:
- A list containing the heads.
-
getHeadsCount
public int getHeadsCount()repeated int32 heads = 2;
- Specified by:
getHeadsCount
in interfaceRoutesConstraintProtoOrBuilder
- Returns:
- The count of heads.
-
getHeads
public int getHeads(int index) repeated int32 heads = 2;
- Specified by:
getHeads
in interfaceRoutesConstraintProtoOrBuilder
- Parameters:
index
- The index of the element to return.- Returns:
- The heads at the given index.
-
getLiteralsList
repeated int32 literals = 3;
- Specified by:
getLiteralsList
in interfaceRoutesConstraintProtoOrBuilder
- Returns:
- A list containing the literals.
-
getLiteralsCount
public int getLiteralsCount()repeated int32 literals = 3;
- Specified by:
getLiteralsCount
in interfaceRoutesConstraintProtoOrBuilder
- Returns:
- The count of literals.
-
getLiterals
public int getLiterals(int index) repeated int32 literals = 3;
- Specified by:
getLiterals
in 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:
getDemandsList
in 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:
getDemandsCount
in 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:
getDemands
in 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:
getCapacity
in 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:
getDimensionsList
in 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:
getDimensionsOrBuilderList
in 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:
getDimensionsCount
in 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:
getDimensions
in 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:
getDimensionsOrBuilder
in interfaceRoutesConstraintProtoOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessage
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in 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:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RoutesConstraintProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForType
in classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-