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.intThe 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.Descriptorcom.google.protobuf.Descriptors.DescriptorgetName()The name of the problem.com.google.protobuf.ByteStringThe name of the problem.intThe number of variables in the problem.The objective of the problem.The objective of the problem.The objective of the problem.intHack: 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.ByteStringgetVarNamesBytes(int index) The names of the problem variables.intThe names of the problem variables.com.google.protobuf.ProtocolStringListThe names of the problem variables.booleanStores an assignment of the problem variables.booleanhasName()The name of the problem.booleanThe number of variables in the problem.booleanThe objective of the problem.booleanHack: When converting a wcnf formulat to a LinearBooleanProblem, extra variables need to be created.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeAssignment(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, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods 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:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LinearBooleanProblem.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin 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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin 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:
hasNamein interfaceLinearBooleanProblemOrBuilder- Returns:
- Whether the name field is set.
-
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.
-
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:
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.
-
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:
getConstraintsListin interfaceLinearBooleanProblemOrBuilder
-
getConstraintsCount
public int getConstraintsCount()The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsCountin interfaceLinearBooleanProblemOrBuilder
-
getConstraints
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsin 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:
getConstraintsOrBuilderin interfaceLinearBooleanProblemOrBuilder
-
getConstraintsOrBuilderList
The constraints of the problem.
repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;- Specified by:
getConstraintsOrBuilderListin 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:
hasObjectivein 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:
getObjectivein 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:
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
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.
-
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:
hasAssignmentin 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:
getAssignmentin 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:
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.
-
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.
-