Class 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 type operations_research.sat.LinearBooleanProblem
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected java.lang.Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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 java.lang.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.
      • getConstraintsCount

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

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

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

        public boolean equals​(java.lang.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​(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:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • 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.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
      • getDefaultInstanceForType

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