Class LinearBooleanProblem

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
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, Serializable

@Generated public final class LinearBooleanProblem extends com.google.protobuf.GeneratedMessage implements LinearBooleanProblemOrBuilder
 A linear Boolean problem.
 
Protobuf type operations_research.sat.LinearBooleanProblem
See Also:
  • Field Details

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • NUM_VARIABLES_FIELD_NUMBER

      public static final int NUM_VARIABLES_FIELD_NUMBER
      See Also:
    • CONSTRAINTS_FIELD_NUMBER

      public static final int CONSTRAINTS_FIELD_NUMBER
      See Also:
    • OBJECTIVE_FIELD_NUMBER

      public static final int OBJECTIVE_FIELD_NUMBER
      See Also:
    • VAR_NAMES_FIELD_NUMBER

      public static final int VAR_NAMES_FIELD_NUMBER
      See Also:
    • ASSIGNMENT_FIELD_NUMBER

      public static final int ASSIGNMENT_FIELD_NUMBER
      See Also:
    • ORIGINAL_NUM_VARIABLES_FIELD_NUMBER

      public static final int ORIGINAL_NUM_VARIABLES_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 class com.google.protobuf.GeneratedMessage
    • 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.
    • 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.
    • getConstraintsList

      public List<LinearBooleanConstraint> getConstraintsList()
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraintsList 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
    • 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
    • getConstraintsOrBuilder

      public LinearBooleanConstraintOrBuilder getConstraintsOrBuilder(int index)
       The constraints of the problem.
       
      repeated .operations_research.sat.LinearBooleanConstraint constraints = 4;
      Specified by:
      getConstraintsOrBuilder in interface LinearBooleanProblemOrBuilder
    • 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.
    • 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.
    • 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.
    • 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.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static LinearBooleanProblem parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LinearBooleanProblem parseFrom(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(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LinearBooleanProblem parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LinearBooleanProblem parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LinearBooleanProblem parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LinearBooleanProblem parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LinearBooleanProblem parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

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

      public static LinearBooleanProblem.Builder newBuilder()
    • newBuilder

      public static LinearBooleanProblem.Builder newBuilder(LinearBooleanProblem prototype)
    • toBuilder

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

      protected LinearBooleanProblem.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static LinearBooleanProblem getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<LinearBooleanProblem> parser()
    • getParserForType

      public com.google.protobuf.Parser<LinearBooleanProblem> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

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