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 Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanProblem.Builder>
    • getDefaultInstanceForType

      public LinearBooleanProblem getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public LinearBooleanProblem build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public LinearBooleanProblem buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public LinearBooleanProblem.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<LinearBooleanProblem.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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 interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.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 interface LinearBooleanProblemOrBuilder
      Returns:
      Whether the name field is set.
    • getName

      public String getName()
       The name of the problem.
       
      optional string name = 1 [default = ""];
      Specified by:
      getName in interface LinearBooleanProblemOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The name of the problem.
       
      optional string name = 1 [default = ""];
      Specified by:
      getNameBytes in interface LinearBooleanProblemOrBuilder
      Returns:
      The bytes for name.
    • setName

      public LinearBooleanProblem.Builder setName(String value)
       The name of the problem.
       
      optional string name = 1 [default = ""];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public LinearBooleanProblem.Builder clearName()
       The name of the problem.
       
      optional string name = 1 [default = ""];
      Returns:
      This builder for chaining.
    • setNameBytes

      public LinearBooleanProblem.Builder setNameBytes(com.google.protobuf.ByteString value)
       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 interface LinearBooleanProblemOrBuilder
      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 interface LinearBooleanProblemOrBuilder
      Returns:
      The numVariables.
    • setNumVariables

      public LinearBooleanProblem.Builder setNumVariables(int value)
       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

      public LinearBooleanProblem.Builder 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

      public List<LinearBooleanConstraint> getConstraintsList()
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraintsList in interface LinearBooleanProblemOrBuilder
    • getConstraintsCount

      public int getConstraintsCount()
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraintsCount in interface LinearBooleanProblemOrBuilder
    • getConstraints

      public LinearBooleanConstraint getConstraints(int index)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraints in interface LinearBooleanProblemOrBuilder
    • setConstraints

      public LinearBooleanProblem.Builder setConstraints(int index, LinearBooleanConstraint value)
       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

      public LinearBooleanProblem.Builder addConstraints(int index, LinearBooleanConstraint value)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
    • addConstraints

      public LinearBooleanProblem.Builder addConstraints(LinearBooleanConstraint.Builder builderForValue)
       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

      public LinearBooleanProblem.Builder clearConstraints()
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
    • removeConstraints

      public LinearBooleanProblem.Builder removeConstraints(int index)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
    • getConstraintsBuilder

      public LinearBooleanConstraint.Builder getConstraintsBuilder(int index)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
    • getConstraintsOrBuilder

      public LinearBooleanConstraintOrBuilder getConstraintsOrBuilder(int index)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraintsOrBuilder in interface LinearBooleanProblemOrBuilder
    • getConstraintsOrBuilderList

      public List<? extends LinearBooleanConstraintOrBuilder> getConstraintsOrBuilderList()
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraintsOrBuilderList in interface LinearBooleanProblemOrBuilder
    • addConstraintsBuilder

      public LinearBooleanConstraint.Builder addConstraintsBuilder()
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
    • addConstraintsBuilder

      public LinearBooleanConstraint.Builder addConstraintsBuilder(int index)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
    • getConstraintsBuilderList

      public List<LinearBooleanConstraint.Builder> 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 interface LinearBooleanProblemOrBuilder
      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:
      getObjective in interface LinearBooleanProblemOrBuilder
      Returns:
      The objective.
    • setObjective

      public LinearBooleanProblem.Builder setObjective(LinearObjective value)
       The objective of the problem.
       If left empty, we just have a satisfiability problem.
       
      optional .operations_research.sat.LinearObjective objective = 5;
    • setObjective

      public LinearBooleanProblem.Builder setObjective(LinearObjective.Builder builderForValue)
       The objective of the problem.
       If left empty, we just have a satisfiability problem.
       
      optional .operations_research.sat.LinearObjective objective = 5;
    • mergeObjective

      public LinearBooleanProblem.Builder mergeObjective(LinearObjective value)
       The objective of the problem.
       If left empty, we just have a satisfiability problem.
       
      optional .operations_research.sat.LinearObjective objective = 5;
    • clearObjective

      public LinearBooleanProblem.Builder clearObjective()
       The objective of the problem.
       If left empty, we just have a satisfiability problem.
       
      optional .operations_research.sat.LinearObjective objective = 5;
    • getObjectiveBuilder

      public LinearObjective.Builder getObjectiveBuilder()
       The objective of the problem.
       If left empty, we just have a satisfiability problem.
       
      optional .operations_research.sat.LinearObjective objective = 5;
    • 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:
      getObjectiveOrBuilder in interface LinearBooleanProblemOrBuilder
    • 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 interface LinearBooleanProblemOrBuilder
      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 interface LinearBooleanProblemOrBuilder
      Returns:
      The count of varNames.
    • getVarNames

      public 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:
      getVarNames in interface LinearBooleanProblemOrBuilder
      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 interface LinearBooleanProblemOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the varNames at the given index.
    • setVarNames

      public LinearBooleanProblem.Builder setVarNames(int index, String value)
       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

      public LinearBooleanProblem.Builder addVarNames(String value)
       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

      public LinearBooleanProblem.Builder addAllVarNames(Iterable<String> values)
       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

      public LinearBooleanProblem.Builder 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

      public LinearBooleanProblem.Builder addVarNamesBytes(com.google.protobuf.ByteString value)
       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 interface LinearBooleanProblemOrBuilder
      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:
      getAssignment in interface LinearBooleanProblemOrBuilder
      Returns:
      The assignment.
    • setAssignment

      public LinearBooleanProblem.Builder setAssignment(BooleanAssignment value)
       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

      public LinearBooleanProblem.Builder setAssignment(BooleanAssignment.Builder builderForValue)
       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

      public LinearBooleanProblem.Builder mergeAssignment(BooleanAssignment value)
       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

      public LinearBooleanProblem.Builder 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

      public BooleanAssignment.Builder 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

      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:
      getAssignmentOrBuilder in interface LinearBooleanProblemOrBuilder
    • 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 interface LinearBooleanProblemOrBuilder
      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 interface LinearBooleanProblemOrBuilder
      Returns:
      The originalNumVariables.
    • setOriginalNumVariables

      public LinearBooleanProblem.Builder setOriginalNumVariables(int value)
       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

      public LinearBooleanProblem.Builder 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.