Class LinearBooleanProblem.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<LinearBooleanProblem.Builder>
com.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
com.google.ortools.sat.LinearBooleanProblem.Builder
- All Implemented Interfaces:
LinearBooleanProblemOrBuilder
,com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,Cloneable
- Enclosing class:
LinearBooleanProblem
public static final class LinearBooleanProblem.Builder
extends com.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
implements LinearBooleanProblemOrBuilder
A linear Boolean problem.Protobuf type
operations_research.sat.LinearBooleanProblem
-
Method Summary
Modifier and TypeMethodDescriptionaddAllConstraints
(Iterable<? extends LinearBooleanConstraint> values) The constraints of the problem.addAllVarNames
(Iterable<String> values) The names of the problem variables.addConstraints
(int index, LinearBooleanConstraint value) The constraints of the problem.addConstraints
(int index, LinearBooleanConstraint.Builder builderForValue) The constraints of the problem.The constraints of the problem.addConstraints
(LinearBooleanConstraint.Builder builderForValue) The constraints of the problem.The constraints of the problem.addConstraintsBuilder
(int index) The constraints of the problem.addVarNames
(String value) The names of the problem variables.addVarNamesBytes
(com.google.protobuf.ByteString value) The names of the problem variables.build()
clear()
Stores an assignment of the problem variables.The constraints of the problem.The name of the problem.The number of variables in the problem.The objective of the problem.Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.The names of the problem variables.Stores an assignment of the problem variables.Stores an assignment of the problem variables.Stores an assignment of the problem variables.getConstraints
(int index) The constraints of the problem.getConstraintsBuilder
(int index) The constraints of the problem.The constraints of the problem.int
The constraints of the problem.The constraints of the problem.getConstraintsOrBuilder
(int index) The constraints of the problem.List
<? extends LinearBooleanConstraintOrBuilder> The constraints of the problem.static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
getName()
The name of the problem.com.google.protobuf.ByteString
The name of the problem.int
The number of variables in the problem.The objective of the problem.The objective of the problem.The objective of the problem.int
Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.getVarNames
(int index) The names of the problem variables.com.google.protobuf.ByteString
getVarNamesBytes
(int index) The names of the problem variables.int
The names of the problem variables.com.google.protobuf.ProtocolStringList
The names of the problem variables.boolean
Stores an assignment of the problem variables.boolean
hasName()
The name of the problem.boolean
The number of variables in the problem.boolean
The objective of the problem.boolean
Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
mergeAssignment
(BooleanAssignment value) Stores an assignment of the problem variables.mergeFrom
(LinearBooleanProblem other) mergeFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom
(com.google.protobuf.Message other) mergeObjective
(LinearObjective value) The objective of the problem.removeConstraints
(int index) The constraints of the problem.setAssignment
(BooleanAssignment value) Stores an assignment of the problem variables.setAssignment
(BooleanAssignment.Builder builderForValue) Stores an assignment of the problem variables.setConstraints
(int index, LinearBooleanConstraint value) The constraints of the problem.setConstraints
(int index, LinearBooleanConstraint.Builder builderForValue) The constraints of the problem.The name of the problem.setNameBytes
(com.google.protobuf.ByteString value) The name of the problem.setNumVariables
(int value) The number of variables in the problem.setObjective
(LinearObjective value) The objective of the problem.setObjective
(LinearObjective.Builder builderForValue) The objective of the problem.setOriginalNumVariables
(int value) Hack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.setVarNames
(int index, String value) The names of the problem variables.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
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.Builder<LinearBooleanProblem.Builder>
-
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<LinearBooleanProblem.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
-
mergeFrom
public LinearBooleanProblem.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<LinearBooleanProblem.Builder>
- Throws:
IOException
-
hasName
public boolean hasName()The name of the problem.
optional string name = 1 [default = ""];
- Specified by:
hasName
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- Whether the name field is set.
-
getName
The name of the problem.
optional string name = 1 [default = ""];
- Specified by:
getName
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The name of the problem.
optional string name = 1 [default = ""];
- Specified by:
getNameBytes
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The bytes for name.
-
setName
The name of the problem.
optional string name = 1 [default = ""];
- Parameters:
value
- The name to set.- Returns:
- This builder for chaining.
-
clearName
The name of the problem.
optional string name = 1 [default = ""];
- Returns:
- This builder for chaining.
-
setNameBytes
The name of the problem.
optional string name = 1 [default = ""];
- Parameters:
value
- The bytes for name to set.- Returns:
- This builder for chaining.
-
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:
hasNumVariables
in 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:
getNumVariables
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The numVariables.
-
setNumVariables
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;
- Parameters:
value
- The numVariables to set.- Returns:
- This builder for chaining.
-
clearNumVariables
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;
- Returns:
- This builder for chaining.
-
getConstraintsList
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
- Specified by:
getConstraintsList
in interfaceLinearBooleanProblemOrBuilder
-
getConstraintsCount
public int getConstraintsCount()The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
- Specified by:
getConstraintsCount
in interfaceLinearBooleanProblemOrBuilder
-
getConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
- Specified by:
getConstraints
in interfaceLinearBooleanProblemOrBuilder
-
setConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
setConstraints
public LinearBooleanProblem.Builder setConstraints(int index, LinearBooleanConstraint.Builder builderForValue) The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
addConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
addConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
addConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
addConstraints
public LinearBooleanProblem.Builder addConstraints(int index, LinearBooleanConstraint.Builder builderForValue) The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
addAllConstraints
public LinearBooleanProblem.Builder addAllConstraints(Iterable<? extends LinearBooleanConstraint> values) The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
clearConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
removeConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
getConstraintsBuilder
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
getConstraintsOrBuilder
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
- Specified by:
getConstraintsOrBuilder
in interfaceLinearBooleanProblemOrBuilder
-
getConstraintsOrBuilderList
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
- Specified by:
getConstraintsOrBuilderList
in interfaceLinearBooleanProblemOrBuilder
-
addConstraintsBuilder
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
addConstraintsBuilder
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
getConstraintsBuilderList
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
-
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:
hasObjective
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- Whether the objective field is set.
-
getObjective
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
- Specified by:
getObjective
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The objective.
-
setObjective
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
-
setObjective
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
-
mergeObjective
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
-
clearObjective
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
-
getObjectiveBuilder
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
-
getObjectiveOrBuilder
The objective of the problem. If left empty, we just have a satisfiability problem.
optional .operations_research.sat.LinearObjective objective = 5;
- Specified by:
getObjectiveOrBuilder
in 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:
getVarNamesList
in 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:
getVarNamesCount
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The count of varNames.
-
getVarNames
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:
getVarNames
in 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:
getVarNamesBytes
in interfaceLinearBooleanProblemOrBuilder
- Parameters:
index
- The index of the value to return.- Returns:
- The bytes of the varNames at the given index.
-
setVarNames
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;
- Parameters:
index
- The index to set the value at.value
- The varNames to set.- Returns:
- This builder for chaining.
-
addVarNames
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;
- Parameters:
value
- The varNames to add.- Returns:
- This builder for chaining.
-
addAllVarNames
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;
- Parameters:
values
- The varNames to add.- Returns:
- This builder for chaining.
-
clearVarNames
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;
- Returns:
- This builder for chaining.
-
addVarNamesBytes
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;
- Parameters:
value
- The bytes of the varNames to add.- Returns:
- This builder for chaining.
-
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:
hasAssignment
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- Whether the assignment field is set.
-
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:
getAssignment
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The assignment.
-
setAssignment
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;
-
setAssignment
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;
-
mergeAssignment
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;
-
clearAssignment
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;
-
getAssignmentBuilder
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;
-
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:
getAssignmentOrBuilder
in 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:
hasOriginalNumVariables
in 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:
getOriginalNumVariables
in interfaceLinearBooleanProblemOrBuilder
- Returns:
- The originalNumVariables.
-
setOriginalNumVariables
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;
- Parameters:
value
- The originalNumVariables to set.- Returns:
- This builder for chaining.
-
clearOriginalNumVariables
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;
- Returns:
- This builder for chaining.
-