Package com.google.ortools.sat
Class LinearBooleanProblem
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- com.google.ortools.sat.LinearBooleanProblem
-
- All Implemented Interfaces:
LinearBooleanProblemOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,java.io.Serializable
public final class LinearBooleanProblem extends com.google.protobuf.GeneratedMessageV3 implements LinearBooleanProblemOrBuilder
A linear Boolean problem.
Protobuf typeoperations_research.sat.LinearBooleanProblem- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLinearBooleanProblem.BuilderA linear Boolean problem.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intASSIGNMENT_FIELD_NUMBERstatic intCONSTRAINTS_FIELD_NUMBERstatic intNAME_FIELD_NUMBERstatic intNUM_VARIABLES_FIELD_NUMBERstatic intOBJECTIVE_FIELD_NUMBERstatic intORIGINAL_NUM_VARIABLES_FIELD_NUMBERstatic com.google.protobuf.Parser<LinearBooleanProblem>PARSERDeprecated.static intVAR_NAMES_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)BooleanAssignmentgetAssignment()Stores an assignment of the problem variables.BooleanAssignmentOrBuildergetAssignmentOrBuilder()Stores an assignment of the problem variables.LinearBooleanConstraintgetConstraints(int index)The constraints of the problem.intgetConstraintsCount()The constraints of the problem.java.util.List<LinearBooleanConstraint>getConstraintsList()The constraints of the problem.LinearBooleanConstraintOrBuildergetConstraintsOrBuilder(int index)The constraints of the problem.java.util.List<? extends LinearBooleanConstraintOrBuilder>getConstraintsOrBuilderList()The constraints of the problem.static LinearBooleanProblemgetDefaultInstance()LinearBooleanProblemgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()java.lang.StringgetName()The name of the problem.com.google.protobuf.ByteStringgetNameBytes()The name of the problem.intgetNumVariables()The number of variables in the problem.LinearObjectivegetObjective()The objective of the problem.LinearObjectiveOrBuildergetObjectiveOrBuilder()The objective of the problem.intgetOriginalNumVariables()Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.com.google.protobuf.Parser<LinearBooleanProblem>getParserForType()intgetSerializedSize()java.lang.StringgetVarNames(int index)The names of the problem variables.com.google.protobuf.ByteStringgetVarNamesBytes(int index)The names of the problem variables.intgetVarNamesCount()The names of the problem variables.com.google.protobuf.ProtocolStringListgetVarNamesList()The names of the problem variables.booleanhasAssignment()Stores an assignment of the problem variables.inthashCode()booleanhasName()The name of the problem.booleanhasNumVariables()The number of variables in the problem.booleanhasObjective()The objective of the problem.booleanhasOriginalNumVariables()Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static LinearBooleanProblem.BuildernewBuilder()static LinearBooleanProblem.BuildernewBuilder(LinearBooleanProblem prototype)LinearBooleanProblem.BuildernewBuilderForType()protected LinearBooleanProblem.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected java.lang.ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static LinearBooleanProblemparseDelimitedFrom(java.io.InputStream input)static LinearBooleanProblemparseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LinearBooleanProblemparseFrom(byte[] data)static LinearBooleanProblemparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LinearBooleanProblemparseFrom(com.google.protobuf.ByteString data)static LinearBooleanProblemparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LinearBooleanProblemparseFrom(com.google.protobuf.CodedInputStream input)static LinearBooleanProblemparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LinearBooleanProblemparseFrom(java.io.InputStream input)static LinearBooleanProblemparseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LinearBooleanProblemparseFrom(java.nio.ByteBuffer data)static LinearBooleanProblemparseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<LinearBooleanProblem>parser()LinearBooleanProblem.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, 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, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
NUM_VARIABLES_FIELD_NUMBER
public static final int NUM_VARIABLES_FIELD_NUMBER
- See Also:
- Constant Field Values
-
CONSTRAINTS_FIELD_NUMBER
public static final int CONSTRAINTS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
OBJECTIVE_FIELD_NUMBER
public static final int OBJECTIVE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
VAR_NAMES_FIELD_NUMBER
public static final int VAR_NAMES_FIELD_NUMBER
- See Also:
- Constant Field Values
-
ASSIGNMENT_FIELD_NUMBER
public static final int ASSIGNMENT_FIELD_NUMBER
- See Also:
- Constant Field Values
-
ORIGINAL_NUM_VARIABLES_FIELD_NUMBER
public static final int ORIGINAL_NUM_VARIABLES_FIELD_NUMBER
- See Also:
- Constant Field Values
-
PARSER
@Deprecated public static final com.google.protobuf.Parser<LinearBooleanProblem> PARSER
Deprecated.
-
-
Method Detail
-
newInstance
protected java.lang.Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
hasName
public boolean hasName()
The name of the problem.
optional string name = 1 [default = ""];- Specified by:
hasNamein interfaceLinearBooleanProblemOrBuilder- Returns:
- Whether the name field is set.
-
getName
public java.lang.String getName()
The name of the problem.
optional string name = 1 [default = ""];- Specified by:
getNamein interfaceLinearBooleanProblemOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()
The name of the problem.
optional string name = 1 [default = ""];- Specified by:
getNameBytesin interfaceLinearBooleanProblemOrBuilder- Returns:
- The bytes for name.
-
hasNumVariables
public boolean hasNumVariables()
The number of variables in the problem. All the signed representation of the problem literals must be in [-num_variables, num_variables], excluding 0.
optional int32 num_variables = 3;- Specified by:
hasNumVariablesin interfaceLinearBooleanProblemOrBuilder- Returns:
- Whether the numVariables field is set.
-
getNumVariables
public int getNumVariables()
The number of variables in the problem. All the signed representation of the problem literals must be in [-num_variables, num_variables], excluding 0.
optional int32 num_variables = 3;- Specified by:
getNumVariablesin interfaceLinearBooleanProblemOrBuilder- Returns:
- The numVariables.
-
getConstraintsList
public java.util.List<LinearBooleanConstraint> getConstraintsList()
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsListin interfaceLinearBooleanProblemOrBuilder
-
getConstraintsOrBuilderList
public java.util.List<? extends LinearBooleanConstraintOrBuilder> getConstraintsOrBuilderList()
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsOrBuilderListin interfaceLinearBooleanProblemOrBuilder
-
getConstraintsCount
public int getConstraintsCount()
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsCountin interfaceLinearBooleanProblemOrBuilder
-
getConstraints
public LinearBooleanConstraint getConstraints(int index)
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsin interfaceLinearBooleanProblemOrBuilder
-
getConstraintsOrBuilder
public LinearBooleanConstraintOrBuilder getConstraintsOrBuilder(int index)
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsOrBuilderin interfaceLinearBooleanProblemOrBuilder
-
hasObjective
public boolean hasObjective()
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;- Specified by:
hasObjectivein interfaceLinearBooleanProblemOrBuilder- Returns:
- Whether the objective field is set.
-
getObjective
public LinearObjective getObjective()
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;- Specified by:
getObjectivein interfaceLinearBooleanProblemOrBuilder- Returns:
- The objective.
-
getObjectiveOrBuilder
public LinearObjectiveOrBuilder getObjectiveOrBuilder()
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;- Specified by:
getObjectiveOrBuilderin interfaceLinearBooleanProblemOrBuilder
-
getVarNamesList
public com.google.protobuf.ProtocolStringList getVarNamesList()
The names of the problem variables. The variables index are 0-based and var_names[i] will be the name of the i-th variable which correspond to literals +(i + 1) or -(i + 1). This is optional and can be left empty.
repeated string var_names = 6;- Specified by:
getVarNamesListin interfaceLinearBooleanProblemOrBuilder- Returns:
- A list containing the varNames.
-
getVarNamesCount
public int getVarNamesCount()
The names of the problem variables. The variables index are 0-based and var_names[i] will be the name of the i-th variable which correspond to literals +(i + 1) or -(i + 1). This is optional and can be left empty.
repeated string var_names = 6;- Specified by:
getVarNamesCountin interfaceLinearBooleanProblemOrBuilder- Returns:
- The count of varNames.
-
getVarNames
public java.lang.String getVarNames(int index)
The names of the problem variables. The variables index are 0-based and var_names[i] will be the name of the i-th variable which correspond to literals +(i + 1) or -(i + 1). This is optional and can be left empty.
repeated string var_names = 6;- Specified by:
getVarNamesin interfaceLinearBooleanProblemOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The varNames at the given index.
-
getVarNamesBytes
public com.google.protobuf.ByteString getVarNamesBytes(int index)
The names of the problem variables. The variables index are 0-based and var_names[i] will be the name of the i-th variable which correspond to literals +(i + 1) or -(i + 1). This is optional and can be left empty.
repeated string var_names = 6;- Specified by:
getVarNamesBytesin interfaceLinearBooleanProblemOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the varNames at the given index.
-
hasAssignment
public boolean hasAssignment()
Stores an assignment of the problem variables. That may be an initial feasible solution, just a partial assignment or the optimal solution.
optional .operations_research.sat.BooleanAssignment assignment = 7;- Specified by:
hasAssignmentin interfaceLinearBooleanProblemOrBuilder- Returns:
- Whether the assignment field is set.
-
getAssignment
public BooleanAssignment getAssignment()
Stores an assignment of the problem variables. That may be an initial feasible solution, just a partial assignment or the optimal solution.
optional .operations_research.sat.BooleanAssignment assignment = 7;- Specified by:
getAssignmentin interfaceLinearBooleanProblemOrBuilder- Returns:
- The assignment.
-
getAssignmentOrBuilder
public BooleanAssignmentOrBuilder getAssignmentOrBuilder()
Stores an assignment of the problem variables. That may be an initial feasible solution, just a partial assignment or the optimal solution.
optional .operations_research.sat.BooleanAssignment assignment = 7;- Specified by:
getAssignmentOrBuilderin interfaceLinearBooleanProblemOrBuilder
-
hasOriginalNumVariables
public boolean hasOriginalNumVariables()
Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created. This stores the number of variables in the original problem (which are in one to one correspondence with the first variables of this problem).
optional int32 original_num_variables = 8;- Specified by:
hasOriginalNumVariablesin interfaceLinearBooleanProblemOrBuilder- Returns:
- Whether the originalNumVariables field is set.
-
getOriginalNumVariables
public int getOriginalNumVariables()
Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created. This stores the number of variables in the original problem (which are in one to one correspondence with the first variables of this problem).
optional int32 original_num_variables = 8;- Specified by:
getOriginalNumVariablesin interfaceLinearBooleanProblemOrBuilder- Returns:
- The originalNumVariables.
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
java.io.IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(java.lang.Object obj)
- 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 LinearBooleanProblem parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static LinearBooleanProblem parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static LinearBooleanProblem parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static LinearBooleanProblem parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static LinearBooleanProblem parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static LinearBooleanProblem parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static LinearBooleanProblem parseFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static LinearBooleanProblem parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static LinearBooleanProblem parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDelimitedFrom
public static LinearBooleanProblem parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static LinearBooleanProblem parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
parseFrom
public static LinearBooleanProblem parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Throws:
java.io.IOException
-
newBuilderForType
public LinearBooleanProblem.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static LinearBooleanProblem.Builder newBuilder()
-
newBuilder
public static LinearBooleanProblem.Builder newBuilder(LinearBooleanProblem prototype)
-
toBuilder
public LinearBooleanProblem.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected LinearBooleanProblem.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static LinearBooleanProblem getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<LinearBooleanProblem> parser()
-
getParserForType
public com.google.protobuf.Parser<LinearBooleanProblem> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public LinearBooleanProblem getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-