com.google.ortools.sat.CpModelProto Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ortools/sat/cp_model.proto
package com.google.ortools.sat;
/**
*
* A constraint programming problem.
*
*
* Protobuf type {@code operations_research.sat.CpModelProto}
*/
public final class CpModelProto extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:operations_research.sat.CpModelProto)
CpModelProtoOrBuilder {
private static final long serialVersionUID = 0L;
// Use CpModelProto.newBuilder() to construct.
private CpModelProto(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CpModelProto() {
name_ = "";
variables_ = java.util.Collections.emptyList();
constraints_ = java.util.Collections.emptyList();
searchStrategy_ = java.util.Collections.emptyList();
assumptions_ = emptyIntList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new CpModelProto();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private CpModelProto(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
variables_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
variables_.add(
input.readMessage(com.google.ortools.sat.IntegerVariableProto.parser(), extensionRegistry));
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
constraints_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
constraints_.add(
input.readMessage(com.google.ortools.sat.ConstraintProto.parser(), extensionRegistry));
break;
}
case 34: {
com.google.ortools.sat.CpObjectiveProto.Builder subBuilder = null;
if (objective_ != null) {
subBuilder = objective_.toBuilder();
}
objective_ = input.readMessage(com.google.ortools.sat.CpObjectiveProto.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(objective_);
objective_ = subBuilder.buildPartial();
}
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000004) != 0)) {
searchStrategy_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000004;
}
searchStrategy_.add(
input.readMessage(com.google.ortools.sat.DecisionStrategyProto.parser(), extensionRegistry));
break;
}
case 50: {
com.google.ortools.sat.PartialVariableAssignment.Builder subBuilder = null;
if (solutionHint_ != null) {
subBuilder = solutionHint_.toBuilder();
}
solutionHint_ = input.readMessage(com.google.ortools.sat.PartialVariableAssignment.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(solutionHint_);
solutionHint_ = subBuilder.buildPartial();
}
break;
}
case 56: {
if (!((mutable_bitField0_ & 0x00000008) != 0)) {
assumptions_ = newIntList();
mutable_bitField0_ |= 0x00000008;
}
assumptions_.addInt(input.readInt32());
break;
}
case 58: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) {
assumptions_ = newIntList();
mutable_bitField0_ |= 0x00000008;
}
while (input.getBytesUntilLimit() > 0) {
assumptions_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
variables_ = java.util.Collections.unmodifiableList(variables_);
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
constraints_ = java.util.Collections.unmodifiableList(constraints_);
}
if (((mutable_bitField0_ & 0x00000004) != 0)) {
searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
}
if (((mutable_bitField0_ & 0x00000008) != 0)) {
assumptions_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ortools.sat.CpModelProto.class, com.google.ortools.sat.CpModelProto.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VARIABLES_FIELD_NUMBER = 2;
private java.util.List variables_;
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
@java.lang.Override
public java.util.List getVariablesList() {
return variables_;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
@java.lang.Override
public java.util.List extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
getVariablesOrBuilderList() {
return variables_;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
@java.lang.Override
public int getVariablesCount() {
return variables_.size();
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
@java.lang.Override
public com.google.ortools.sat.IntegerVariableProto getVariables(int index) {
return variables_.get(index);
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
@java.lang.Override
public com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(
int index) {
return variables_.get(index);
}
public static final int CONSTRAINTS_FIELD_NUMBER = 3;
private java.util.List constraints_;
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
@java.lang.Override
public java.util.List getConstraintsList() {
return constraints_;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
@java.lang.Override
public java.util.List extends com.google.ortools.sat.ConstraintProtoOrBuilder>
getConstraintsOrBuilderList() {
return constraints_;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
@java.lang.Override
public int getConstraintsCount() {
return constraints_.size();
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
@java.lang.Override
public com.google.ortools.sat.ConstraintProto getConstraints(int index) {
return constraints_.get(index);
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
@java.lang.Override
public com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(
int index) {
return constraints_.get(index);
}
public static final int OBJECTIVE_FIELD_NUMBER = 4;
private com.google.ortools.sat.CpObjectiveProto objective_;
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
* @return Whether the objective field is set.
*/
@java.lang.Override
public boolean hasObjective() {
return objective_ != null;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
* @return The objective.
*/
@java.lang.Override
public com.google.ortools.sat.CpObjectiveProto getObjective() {
return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
@java.lang.Override
public com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder() {
return getObjective();
}
public static final int SEARCH_STRATEGY_FIELD_NUMBER = 5;
private java.util.List searchStrategy_;
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
@java.lang.Override
public java.util.List getSearchStrategyList() {
return searchStrategy_;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
@java.lang.Override
public java.util.List extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
getSearchStrategyOrBuilderList() {
return searchStrategy_;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
@java.lang.Override
public int getSearchStrategyCount() {
return searchStrategy_.size();
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
@java.lang.Override
public com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index) {
return searchStrategy_.get(index);
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
@java.lang.Override
public com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(
int index) {
return searchStrategy_.get(index);
}
public static final int SOLUTION_HINT_FIELD_NUMBER = 6;
private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
* @return Whether the solutionHint field is set.
*/
@java.lang.Override
public boolean hasSolutionHint() {
return solutionHint_ != null;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
* @return The solutionHint.
*/
@java.lang.Override
public com.google.ortools.sat.PartialVariableAssignment getSolutionHint() {
return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
@java.lang.Override
public com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder() {
return getSolutionHint();
}
public static final int ASSUMPTIONS_FIELD_NUMBER = 7;
private com.google.protobuf.Internal.IntList assumptions_;
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @return A list containing the assumptions.
*/
@java.lang.Override
public java.util.List
getAssumptionsList() {
return assumptions_;
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @return The count of assumptions.
*/
public int getAssumptionsCount() {
return assumptions_.size();
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @param index The index of the element to return.
* @return The assumptions at the given index.
*/
public int getAssumptions(int index) {
return assumptions_.getInt(index);
}
private int assumptionsMemoizedSerializedSize = -1;
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
for (int i = 0; i < variables_.size(); i++) {
output.writeMessage(2, variables_.get(i));
}
for (int i = 0; i < constraints_.size(); i++) {
output.writeMessage(3, constraints_.get(i));
}
if (objective_ != null) {
output.writeMessage(4, getObjective());
}
for (int i = 0; i < searchStrategy_.size(); i++) {
output.writeMessage(5, searchStrategy_.get(i));
}
if (solutionHint_ != null) {
output.writeMessage(6, getSolutionHint());
}
if (getAssumptionsList().size() > 0) {
output.writeUInt32NoTag(58);
output.writeUInt32NoTag(assumptionsMemoizedSerializedSize);
}
for (int i = 0; i < assumptions_.size(); i++) {
output.writeInt32NoTag(assumptions_.getInt(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
for (int i = 0; i < variables_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, variables_.get(i));
}
for (int i = 0; i < constraints_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, constraints_.get(i));
}
if (objective_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getObjective());
}
for (int i = 0; i < searchStrategy_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, searchStrategy_.get(i));
}
if (solutionHint_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getSolutionHint());
}
{
int dataSize = 0;
for (int i = 0; i < assumptions_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(assumptions_.getInt(i));
}
size += dataSize;
if (!getAssumptionsList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
assumptionsMemoizedSerializedSize = dataSize;
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.ortools.sat.CpModelProto)) {
return super.equals(obj);
}
com.google.ortools.sat.CpModelProto other = (com.google.ortools.sat.CpModelProto) obj;
if (!getName()
.equals(other.getName())) return false;
if (!getVariablesList()
.equals(other.getVariablesList())) return false;
if (!getConstraintsList()
.equals(other.getConstraintsList())) return false;
if (hasObjective() != other.hasObjective()) return false;
if (hasObjective()) {
if (!getObjective()
.equals(other.getObjective())) return false;
}
if (!getSearchStrategyList()
.equals(other.getSearchStrategyList())) return false;
if (hasSolutionHint() != other.hasSolutionHint()) return false;
if (hasSolutionHint()) {
if (!getSolutionHint()
.equals(other.getSolutionHint())) return false;
}
if (!getAssumptionsList()
.equals(other.getAssumptionsList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
if (getVariablesCount() > 0) {
hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
hash = (53 * hash) + getVariablesList().hashCode();
}
if (getConstraintsCount() > 0) {
hash = (37 * hash) + CONSTRAINTS_FIELD_NUMBER;
hash = (53 * hash) + getConstraintsList().hashCode();
}
if (hasObjective()) {
hash = (37 * hash) + OBJECTIVE_FIELD_NUMBER;
hash = (53 * hash) + getObjective().hashCode();
}
if (getSearchStrategyCount() > 0) {
hash = (37 * hash) + SEARCH_STRATEGY_FIELD_NUMBER;
hash = (53 * hash) + getSearchStrategyList().hashCode();
}
if (hasSolutionHint()) {
hash = (37 * hash) + SOLUTION_HINT_FIELD_NUMBER;
hash = (53 * hash) + getSolutionHint().hashCode();
}
if (getAssumptionsCount() > 0) {
hash = (37 * hash) + ASSUMPTIONS_FIELD_NUMBER;
hash = (53 * hash) + getAssumptionsList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ortools.sat.CpModelProto parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.sat.CpModelProto parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.sat.CpModelProto parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ortools.sat.CpModelProto parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ortools.sat.CpModelProto parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ortools.sat.CpModelProto parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.ortools.sat.CpModelProto prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A constraint programming problem.
*
*
* Protobuf type {@code operations_research.sat.CpModelProto}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:operations_research.sat.CpModelProto)
com.google.ortools.sat.CpModelProtoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ortools.sat.CpModelProto.class, com.google.ortools.sat.CpModelProto.Builder.class);
}
// Construct using com.google.ortools.sat.CpModelProto.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getVariablesFieldBuilder();
getConstraintsFieldBuilder();
getSearchStrategyFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
if (variablesBuilder_ == null) {
variables_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
variablesBuilder_.clear();
}
if (constraintsBuilder_ == null) {
constraints_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
constraintsBuilder_.clear();
}
if (objectiveBuilder_ == null) {
objective_ = null;
} else {
objective_ = null;
objectiveBuilder_ = null;
}
if (searchStrategyBuilder_ == null) {
searchStrategy_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
searchStrategyBuilder_.clear();
}
if (solutionHintBuilder_ == null) {
solutionHint_ = null;
} else {
solutionHint_ = null;
solutionHintBuilder_ = null;
}
assumptions_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpModelProto_descriptor;
}
@java.lang.Override
public com.google.ortools.sat.CpModelProto getDefaultInstanceForType() {
return com.google.ortools.sat.CpModelProto.getDefaultInstance();
}
@java.lang.Override
public com.google.ortools.sat.CpModelProto build() {
com.google.ortools.sat.CpModelProto result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ortools.sat.CpModelProto buildPartial() {
com.google.ortools.sat.CpModelProto result = new com.google.ortools.sat.CpModelProto(this);
int from_bitField0_ = bitField0_;
result.name_ = name_;
if (variablesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
variables_ = java.util.Collections.unmodifiableList(variables_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.variables_ = variables_;
} else {
result.variables_ = variablesBuilder_.build();
}
if (constraintsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
constraints_ = java.util.Collections.unmodifiableList(constraints_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.constraints_ = constraints_;
} else {
result.constraints_ = constraintsBuilder_.build();
}
if (objectiveBuilder_ == null) {
result.objective_ = objective_;
} else {
result.objective_ = objectiveBuilder_.build();
}
if (searchStrategyBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
searchStrategy_ = java.util.Collections.unmodifiableList(searchStrategy_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.searchStrategy_ = searchStrategy_;
} else {
result.searchStrategy_ = searchStrategyBuilder_.build();
}
if (solutionHintBuilder_ == null) {
result.solutionHint_ = solutionHint_;
} else {
result.solutionHint_ = solutionHintBuilder_.build();
}
if (((bitField0_ & 0x00000008) != 0)) {
assumptions_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000008);
}
result.assumptions_ = assumptions_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.ortools.sat.CpModelProto) {
return mergeFrom((com.google.ortools.sat.CpModelProto)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ortools.sat.CpModelProto other) {
if (other == com.google.ortools.sat.CpModelProto.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (variablesBuilder_ == null) {
if (!other.variables_.isEmpty()) {
if (variables_.isEmpty()) {
variables_ = other.variables_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureVariablesIsMutable();
variables_.addAll(other.variables_);
}
onChanged();
}
} else {
if (!other.variables_.isEmpty()) {
if (variablesBuilder_.isEmpty()) {
variablesBuilder_.dispose();
variablesBuilder_ = null;
variables_ = other.variables_;
bitField0_ = (bitField0_ & ~0x00000001);
variablesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getVariablesFieldBuilder() : null;
} else {
variablesBuilder_.addAllMessages(other.variables_);
}
}
}
if (constraintsBuilder_ == null) {
if (!other.constraints_.isEmpty()) {
if (constraints_.isEmpty()) {
constraints_ = other.constraints_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureConstraintsIsMutable();
constraints_.addAll(other.constraints_);
}
onChanged();
}
} else {
if (!other.constraints_.isEmpty()) {
if (constraintsBuilder_.isEmpty()) {
constraintsBuilder_.dispose();
constraintsBuilder_ = null;
constraints_ = other.constraints_;
bitField0_ = (bitField0_ & ~0x00000002);
constraintsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getConstraintsFieldBuilder() : null;
} else {
constraintsBuilder_.addAllMessages(other.constraints_);
}
}
}
if (other.hasObjective()) {
mergeObjective(other.getObjective());
}
if (searchStrategyBuilder_ == null) {
if (!other.searchStrategy_.isEmpty()) {
if (searchStrategy_.isEmpty()) {
searchStrategy_ = other.searchStrategy_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureSearchStrategyIsMutable();
searchStrategy_.addAll(other.searchStrategy_);
}
onChanged();
}
} else {
if (!other.searchStrategy_.isEmpty()) {
if (searchStrategyBuilder_.isEmpty()) {
searchStrategyBuilder_.dispose();
searchStrategyBuilder_ = null;
searchStrategy_ = other.searchStrategy_;
bitField0_ = (bitField0_ & ~0x00000004);
searchStrategyBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getSearchStrategyFieldBuilder() : null;
} else {
searchStrategyBuilder_.addAllMessages(other.searchStrategy_);
}
}
}
if (other.hasSolutionHint()) {
mergeSolutionHint(other.getSolutionHint());
}
if (!other.assumptions_.isEmpty()) {
if (assumptions_.isEmpty()) {
assumptions_ = other.assumptions_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureAssumptionsIsMutable();
assumptions_.addAll(other.assumptions_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.ortools.sat.CpModelProto parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.ortools.sat.CpModelProto) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* For debug/logging only. Can be empty.
*
*
* string name = 1;
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private java.util.List variables_ =
java.util.Collections.emptyList();
private void ensureVariablesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
variables_ = new java.util.ArrayList(variables_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.IntegerVariableProto, com.google.ortools.sat.IntegerVariableProto.Builder, com.google.ortools.sat.IntegerVariableProtoOrBuilder> variablesBuilder_;
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public java.util.List getVariablesList() {
if (variablesBuilder_ == null) {
return java.util.Collections.unmodifiableList(variables_);
} else {
return variablesBuilder_.getMessageList();
}
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public int getVariablesCount() {
if (variablesBuilder_ == null) {
return variables_.size();
} else {
return variablesBuilder_.getCount();
}
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public com.google.ortools.sat.IntegerVariableProto getVariables(int index) {
if (variablesBuilder_ == null) {
return variables_.get(index);
} else {
return variablesBuilder_.getMessage(index);
}
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder setVariables(
int index, com.google.ortools.sat.IntegerVariableProto value) {
if (variablesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVariablesIsMutable();
variables_.set(index, value);
onChanged();
} else {
variablesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder setVariables(
int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
if (variablesBuilder_ == null) {
ensureVariablesIsMutable();
variables_.set(index, builderForValue.build());
onChanged();
} else {
variablesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder addVariables(com.google.ortools.sat.IntegerVariableProto value) {
if (variablesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVariablesIsMutable();
variables_.add(value);
onChanged();
} else {
variablesBuilder_.addMessage(value);
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder addVariables(
int index, com.google.ortools.sat.IntegerVariableProto value) {
if (variablesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureVariablesIsMutable();
variables_.add(index, value);
onChanged();
} else {
variablesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder addVariables(
com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
if (variablesBuilder_ == null) {
ensureVariablesIsMutable();
variables_.add(builderForValue.build());
onChanged();
} else {
variablesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder addVariables(
int index, com.google.ortools.sat.IntegerVariableProto.Builder builderForValue) {
if (variablesBuilder_ == null) {
ensureVariablesIsMutable();
variables_.add(index, builderForValue.build());
onChanged();
} else {
variablesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder addAllVariables(
java.lang.Iterable extends com.google.ortools.sat.IntegerVariableProto> values) {
if (variablesBuilder_ == null) {
ensureVariablesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, variables_);
onChanged();
} else {
variablesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder clearVariables() {
if (variablesBuilder_ == null) {
variables_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
variablesBuilder_.clear();
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public Builder removeVariables(int index) {
if (variablesBuilder_ == null) {
ensureVariablesIsMutable();
variables_.remove(index);
onChanged();
} else {
variablesBuilder_.remove(index);
}
return this;
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public com.google.ortools.sat.IntegerVariableProto.Builder getVariablesBuilder(
int index) {
return getVariablesFieldBuilder().getBuilder(index);
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public com.google.ortools.sat.IntegerVariableProtoOrBuilder getVariablesOrBuilder(
int index) {
if (variablesBuilder_ == null) {
return variables_.get(index); } else {
return variablesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public java.util.List extends com.google.ortools.sat.IntegerVariableProtoOrBuilder>
getVariablesOrBuilderList() {
if (variablesBuilder_ != null) {
return variablesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(variables_);
}
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder() {
return getVariablesFieldBuilder().addBuilder(
com.google.ortools.sat.IntegerVariableProto.getDefaultInstance());
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public com.google.ortools.sat.IntegerVariableProto.Builder addVariablesBuilder(
int index) {
return getVariablesFieldBuilder().addBuilder(
index, com.google.ortools.sat.IntegerVariableProto.getDefaultInstance());
}
/**
*
* The associated Protos should be referred by their index in these fields.
*
*
* repeated .operations_research.sat.IntegerVariableProto variables = 2;
*/
public java.util.List
getVariablesBuilderList() {
return getVariablesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.IntegerVariableProto, com.google.ortools.sat.IntegerVariableProto.Builder, com.google.ortools.sat.IntegerVariableProtoOrBuilder>
getVariablesFieldBuilder() {
if (variablesBuilder_ == null) {
variablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.IntegerVariableProto, com.google.ortools.sat.IntegerVariableProto.Builder, com.google.ortools.sat.IntegerVariableProtoOrBuilder>(
variables_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
variables_ = null;
}
return variablesBuilder_;
}
private java.util.List constraints_ =
java.util.Collections.emptyList();
private void ensureConstraintsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
constraints_ = new java.util.ArrayList(constraints_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.ConstraintProto, com.google.ortools.sat.ConstraintProto.Builder, com.google.ortools.sat.ConstraintProtoOrBuilder> constraintsBuilder_;
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public java.util.List getConstraintsList() {
if (constraintsBuilder_ == null) {
return java.util.Collections.unmodifiableList(constraints_);
} else {
return constraintsBuilder_.getMessageList();
}
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public int getConstraintsCount() {
if (constraintsBuilder_ == null) {
return constraints_.size();
} else {
return constraintsBuilder_.getCount();
}
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public com.google.ortools.sat.ConstraintProto getConstraints(int index) {
if (constraintsBuilder_ == null) {
return constraints_.get(index);
} else {
return constraintsBuilder_.getMessage(index);
}
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder setConstraints(
int index, com.google.ortools.sat.ConstraintProto value) {
if (constraintsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConstraintsIsMutable();
constraints_.set(index, value);
onChanged();
} else {
constraintsBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder setConstraints(
int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.set(index, builderForValue.build());
onChanged();
} else {
constraintsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder addConstraints(com.google.ortools.sat.ConstraintProto value) {
if (constraintsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConstraintsIsMutable();
constraints_.add(value);
onChanged();
} else {
constraintsBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder addConstraints(
int index, com.google.ortools.sat.ConstraintProto value) {
if (constraintsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureConstraintsIsMutable();
constraints_.add(index, value);
onChanged();
} else {
constraintsBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder addConstraints(
com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.add(builderForValue.build());
onChanged();
} else {
constraintsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder addConstraints(
int index, com.google.ortools.sat.ConstraintProto.Builder builderForValue) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.add(index, builderForValue.build());
onChanged();
} else {
constraintsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder addAllConstraints(
java.lang.Iterable extends com.google.ortools.sat.ConstraintProto> values) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, constraints_);
onChanged();
} else {
constraintsBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder clearConstraints() {
if (constraintsBuilder_ == null) {
constraints_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
constraintsBuilder_.clear();
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public Builder removeConstraints(int index) {
if (constraintsBuilder_ == null) {
ensureConstraintsIsMutable();
constraints_.remove(index);
onChanged();
} else {
constraintsBuilder_.remove(index);
}
return this;
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public com.google.ortools.sat.ConstraintProto.Builder getConstraintsBuilder(
int index) {
return getConstraintsFieldBuilder().getBuilder(index);
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public com.google.ortools.sat.ConstraintProtoOrBuilder getConstraintsOrBuilder(
int index) {
if (constraintsBuilder_ == null) {
return constraints_.get(index); } else {
return constraintsBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public java.util.List extends com.google.ortools.sat.ConstraintProtoOrBuilder>
getConstraintsOrBuilderList() {
if (constraintsBuilder_ != null) {
return constraintsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(constraints_);
}
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder() {
return getConstraintsFieldBuilder().addBuilder(
com.google.ortools.sat.ConstraintProto.getDefaultInstance());
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public com.google.ortools.sat.ConstraintProto.Builder addConstraintsBuilder(
int index) {
return getConstraintsFieldBuilder().addBuilder(
index, com.google.ortools.sat.ConstraintProto.getDefaultInstance());
}
/**
* repeated .operations_research.sat.ConstraintProto constraints = 3;
*/
public java.util.List
getConstraintsBuilderList() {
return getConstraintsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.ConstraintProto, com.google.ortools.sat.ConstraintProto.Builder, com.google.ortools.sat.ConstraintProtoOrBuilder>
getConstraintsFieldBuilder() {
if (constraintsBuilder_ == null) {
constraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.ConstraintProto, com.google.ortools.sat.ConstraintProto.Builder, com.google.ortools.sat.ConstraintProtoOrBuilder>(
constraints_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
constraints_ = null;
}
return constraintsBuilder_;
}
private com.google.ortools.sat.CpObjectiveProto objective_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ortools.sat.CpObjectiveProto, com.google.ortools.sat.CpObjectiveProto.Builder, com.google.ortools.sat.CpObjectiveProtoOrBuilder> objectiveBuilder_;
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
* @return Whether the objective field is set.
*/
public boolean hasObjective() {
return objectiveBuilder_ != null || objective_ != null;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
* @return The objective.
*/
public com.google.ortools.sat.CpObjectiveProto getObjective() {
if (objectiveBuilder_ == null) {
return objective_ == null ? com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
} else {
return objectiveBuilder_.getMessage();
}
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
public Builder setObjective(com.google.ortools.sat.CpObjectiveProto value) {
if (objectiveBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
objective_ = value;
onChanged();
} else {
objectiveBuilder_.setMessage(value);
}
return this;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
public Builder setObjective(
com.google.ortools.sat.CpObjectiveProto.Builder builderForValue) {
if (objectiveBuilder_ == null) {
objective_ = builderForValue.build();
onChanged();
} else {
objectiveBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
public Builder mergeObjective(com.google.ortools.sat.CpObjectiveProto value) {
if (objectiveBuilder_ == null) {
if (objective_ != null) {
objective_ =
com.google.ortools.sat.CpObjectiveProto.newBuilder(objective_).mergeFrom(value).buildPartial();
} else {
objective_ = value;
}
onChanged();
} else {
objectiveBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
public Builder clearObjective() {
if (objectiveBuilder_ == null) {
objective_ = null;
onChanged();
} else {
objective_ = null;
objectiveBuilder_ = null;
}
return this;
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
public com.google.ortools.sat.CpObjectiveProto.Builder getObjectiveBuilder() {
onChanged();
return getObjectiveFieldBuilder().getBuilder();
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
public com.google.ortools.sat.CpObjectiveProtoOrBuilder getObjectiveOrBuilder() {
if (objectiveBuilder_ != null) {
return objectiveBuilder_.getMessageOrBuilder();
} else {
return objective_ == null ?
com.google.ortools.sat.CpObjectiveProto.getDefaultInstance() : objective_;
}
}
/**
*
* The objective to minimize. Can be empty for pure decision problems.
*
*
* .operations_research.sat.CpObjectiveProto objective = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ortools.sat.CpObjectiveProto, com.google.ortools.sat.CpObjectiveProto.Builder, com.google.ortools.sat.CpObjectiveProtoOrBuilder>
getObjectiveFieldBuilder() {
if (objectiveBuilder_ == null) {
objectiveBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.ortools.sat.CpObjectiveProto, com.google.ortools.sat.CpObjectiveProto.Builder, com.google.ortools.sat.CpObjectiveProtoOrBuilder>(
getObjective(),
getParentForChildren(),
isClean());
objective_ = null;
}
return objectiveBuilder_;
}
private java.util.List searchStrategy_ =
java.util.Collections.emptyList();
private void ensureSearchStrategyIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
searchStrategy_ = new java.util.ArrayList(searchStrategy_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.DecisionStrategyProto, com.google.ortools.sat.DecisionStrategyProto.Builder, com.google.ortools.sat.DecisionStrategyProtoOrBuilder> searchStrategyBuilder_;
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public java.util.List getSearchStrategyList() {
if (searchStrategyBuilder_ == null) {
return java.util.Collections.unmodifiableList(searchStrategy_);
} else {
return searchStrategyBuilder_.getMessageList();
}
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public int getSearchStrategyCount() {
if (searchStrategyBuilder_ == null) {
return searchStrategy_.size();
} else {
return searchStrategyBuilder_.getCount();
}
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public com.google.ortools.sat.DecisionStrategyProto getSearchStrategy(int index) {
if (searchStrategyBuilder_ == null) {
return searchStrategy_.get(index);
} else {
return searchStrategyBuilder_.getMessage(index);
}
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder setSearchStrategy(
int index, com.google.ortools.sat.DecisionStrategyProto value) {
if (searchStrategyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureSearchStrategyIsMutable();
searchStrategy_.set(index, value);
onChanged();
} else {
searchStrategyBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder setSearchStrategy(
int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
if (searchStrategyBuilder_ == null) {
ensureSearchStrategyIsMutable();
searchStrategy_.set(index, builderForValue.build());
onChanged();
} else {
searchStrategyBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder addSearchStrategy(com.google.ortools.sat.DecisionStrategyProto value) {
if (searchStrategyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureSearchStrategyIsMutable();
searchStrategy_.add(value);
onChanged();
} else {
searchStrategyBuilder_.addMessage(value);
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder addSearchStrategy(
int index, com.google.ortools.sat.DecisionStrategyProto value) {
if (searchStrategyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureSearchStrategyIsMutable();
searchStrategy_.add(index, value);
onChanged();
} else {
searchStrategyBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder addSearchStrategy(
com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
if (searchStrategyBuilder_ == null) {
ensureSearchStrategyIsMutable();
searchStrategy_.add(builderForValue.build());
onChanged();
} else {
searchStrategyBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder addSearchStrategy(
int index, com.google.ortools.sat.DecisionStrategyProto.Builder builderForValue) {
if (searchStrategyBuilder_ == null) {
ensureSearchStrategyIsMutable();
searchStrategy_.add(index, builderForValue.build());
onChanged();
} else {
searchStrategyBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder addAllSearchStrategy(
java.lang.Iterable extends com.google.ortools.sat.DecisionStrategyProto> values) {
if (searchStrategyBuilder_ == null) {
ensureSearchStrategyIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, searchStrategy_);
onChanged();
} else {
searchStrategyBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder clearSearchStrategy() {
if (searchStrategyBuilder_ == null) {
searchStrategy_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
searchStrategyBuilder_.clear();
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public Builder removeSearchStrategy(int index) {
if (searchStrategyBuilder_ == null) {
ensureSearchStrategyIsMutable();
searchStrategy_.remove(index);
onChanged();
} else {
searchStrategyBuilder_.remove(index);
}
return this;
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public com.google.ortools.sat.DecisionStrategyProto.Builder getSearchStrategyBuilder(
int index) {
return getSearchStrategyFieldBuilder().getBuilder(index);
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public com.google.ortools.sat.DecisionStrategyProtoOrBuilder getSearchStrategyOrBuilder(
int index) {
if (searchStrategyBuilder_ == null) {
return searchStrategy_.get(index); } else {
return searchStrategyBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public java.util.List extends com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
getSearchStrategyOrBuilderList() {
if (searchStrategyBuilder_ != null) {
return searchStrategyBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(searchStrategy_);
}
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder() {
return getSearchStrategyFieldBuilder().addBuilder(
com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance());
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public com.google.ortools.sat.DecisionStrategyProto.Builder addSearchStrategyBuilder(
int index) {
return getSearchStrategyFieldBuilder().addBuilder(
index, com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance());
}
/**
*
* Defines the strategy that the solver should follow when the
* search_branching parameter is set to FIXED_SEARCH. Note that this strategy
* is also used as a heuristic when we are not in fixed search.
* Advanced Usage: if not all variables appears and the parameter
* "instantiate_all_variables" is set to false, then the solver will not try
* to instantiate the variables that do not appear. Thus, at the end of the
* search, not all variables may be fixed and this is why we have the
* solution_lower_bounds and solution_upper_bounds fields in the
* CpSolverResponse.
*
*
* repeated .operations_research.sat.DecisionStrategyProto search_strategy = 5;
*/
public java.util.List
getSearchStrategyBuilderList() {
return getSearchStrategyFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.DecisionStrategyProto, com.google.ortools.sat.DecisionStrategyProto.Builder, com.google.ortools.sat.DecisionStrategyProtoOrBuilder>
getSearchStrategyFieldBuilder() {
if (searchStrategyBuilder_ == null) {
searchStrategyBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.ortools.sat.DecisionStrategyProto, com.google.ortools.sat.DecisionStrategyProto.Builder, com.google.ortools.sat.DecisionStrategyProtoOrBuilder>(
searchStrategy_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
searchStrategy_ = null;
}
return searchStrategyBuilder_;
}
private com.google.ortools.sat.PartialVariableAssignment solutionHint_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ortools.sat.PartialVariableAssignment, com.google.ortools.sat.PartialVariableAssignment.Builder, com.google.ortools.sat.PartialVariableAssignmentOrBuilder> solutionHintBuilder_;
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
* @return Whether the solutionHint field is set.
*/
public boolean hasSolutionHint() {
return solutionHintBuilder_ != null || solutionHint_ != null;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
* @return The solutionHint.
*/
public com.google.ortools.sat.PartialVariableAssignment getSolutionHint() {
if (solutionHintBuilder_ == null) {
return solutionHint_ == null ? com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
} else {
return solutionHintBuilder_.getMessage();
}
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
public Builder setSolutionHint(com.google.ortools.sat.PartialVariableAssignment value) {
if (solutionHintBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
solutionHint_ = value;
onChanged();
} else {
solutionHintBuilder_.setMessage(value);
}
return this;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
public Builder setSolutionHint(
com.google.ortools.sat.PartialVariableAssignment.Builder builderForValue) {
if (solutionHintBuilder_ == null) {
solutionHint_ = builderForValue.build();
onChanged();
} else {
solutionHintBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
public Builder mergeSolutionHint(com.google.ortools.sat.PartialVariableAssignment value) {
if (solutionHintBuilder_ == null) {
if (solutionHint_ != null) {
solutionHint_ =
com.google.ortools.sat.PartialVariableAssignment.newBuilder(solutionHint_).mergeFrom(value).buildPartial();
} else {
solutionHint_ = value;
}
onChanged();
} else {
solutionHintBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
public Builder clearSolutionHint() {
if (solutionHintBuilder_ == null) {
solutionHint_ = null;
onChanged();
} else {
solutionHint_ = null;
solutionHintBuilder_ = null;
}
return this;
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
public com.google.ortools.sat.PartialVariableAssignment.Builder getSolutionHintBuilder() {
onChanged();
return getSolutionHintFieldBuilder().getBuilder();
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
public com.google.ortools.sat.PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder() {
if (solutionHintBuilder_ != null) {
return solutionHintBuilder_.getMessageOrBuilder();
} else {
return solutionHint_ == null ?
com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance() : solutionHint_;
}
}
/**
*
* Solution hint.
* If a feasible or almost-feasible solution to the problem is already known,
* it may be helpful to pass it to the solver so that it can be used. The
* solver will try to use this information to create its initial feasible
* solution.
* Note that it may not always be faster to give a hint like this to the
* solver. There is also no guarantee that the solver will use this hint or
* try to return a solution "close" to this assignment in case of multiple
* optimal solutions.
*
*
* .operations_research.sat.PartialVariableAssignment solution_hint = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.ortools.sat.PartialVariableAssignment, com.google.ortools.sat.PartialVariableAssignment.Builder, com.google.ortools.sat.PartialVariableAssignmentOrBuilder>
getSolutionHintFieldBuilder() {
if (solutionHintBuilder_ == null) {
solutionHintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.ortools.sat.PartialVariableAssignment, com.google.ortools.sat.PartialVariableAssignment.Builder, com.google.ortools.sat.PartialVariableAssignmentOrBuilder>(
getSolutionHint(),
getParentForChildren(),
isClean());
solutionHint_ = null;
}
return solutionHintBuilder_;
}
private com.google.protobuf.Internal.IntList assumptions_ = emptyIntList();
private void ensureAssumptionsIsMutable() {
if (!((bitField0_ & 0x00000008) != 0)) {
assumptions_ = mutableCopy(assumptions_);
bitField0_ |= 0x00000008;
}
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @return A list containing the assumptions.
*/
public java.util.List
getAssumptionsList() {
return ((bitField0_ & 0x00000008) != 0) ?
java.util.Collections.unmodifiableList(assumptions_) : assumptions_;
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @return The count of assumptions.
*/
public int getAssumptionsCount() {
return assumptions_.size();
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @param index The index of the element to return.
* @return The assumptions at the given index.
*/
public int getAssumptions(int index) {
return assumptions_.getInt(index);
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @param index The index to set the value at.
* @param value The assumptions to set.
* @return This builder for chaining.
*/
public Builder setAssumptions(
int index, int value) {
ensureAssumptionsIsMutable();
assumptions_.setInt(index, value);
onChanged();
return this;
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @param value The assumptions to add.
* @return This builder for chaining.
*/
public Builder addAssumptions(int value) {
ensureAssumptionsIsMutable();
assumptions_.addInt(value);
onChanged();
return this;
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @param values The assumptions to add.
* @return This builder for chaining.
*/
public Builder addAllAssumptions(
java.lang.Iterable extends java.lang.Integer> values) {
ensureAssumptionsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, assumptions_);
onChanged();
return this;
}
/**
*
* A list of literals. The model will be solved assuming all these literals
* are true. Compared to just fixing the domain of these literals, using this
* mechanism is slower but allows in case the model is INFEASIBLE to get a
* potentially small subset of them that can be used to explain the
* infeasibility.
* Think (IIS), except when you are only concerned by the provided
* assumptions. This is powerful as it allows to group a set of logicially
* related constraint under only one enforcement literal which can potentially
* give you a good and interpretable explanation for infeasiblity.
* Such infeasibility explanation will be available in the
* sufficient_assumptions_for_infeasibility response field.
*
*
* repeated int32 assumptions = 7;
* @return This builder for chaining.
*/
public Builder clearAssumptions() {
assumptions_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:operations_research.sat.CpModelProto)
}
// @@protoc_insertion_point(class_scope:operations_research.sat.CpModelProto)
private static final com.google.ortools.sat.CpModelProto DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ortools.sat.CpModelProto();
}
public static com.google.ortools.sat.CpModelProto getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CpModelProto parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new CpModelProto(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.ortools.sat.CpModelProto getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy