Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DecisionStrategyProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/sat/cp_model.proto
3
4// Protobuf Java Version: 3.25.3
5package com.google.ortools.sat;
6
15public final class DecisionStrategyProto extends
16 com.google.protobuf.GeneratedMessageV3 implements
17 // @@protoc_insertion_point(message_implements:operations_research.sat.DecisionStrategyProto)
19private static final long serialVersionUID = 0L;
20 // Use DecisionStrategyProto.newBuilder() to construct.
21 private DecisionStrategyProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
22 super(builder);
23 }
24 private DecisionStrategyProto() {
25 variables_ = emptyIntList();
26 exprs_ = java.util.Collections.emptyList();
27 variableSelectionStrategy_ = 0;
28 domainReductionStrategy_ = 0;
29 }
30
31 @java.lang.Override
32 @SuppressWarnings({"unused"})
33 protected java.lang.Object newInstance(
34 UnusedPrivateParameter unused) {
35 return new DecisionStrategyProto();
36 }
37
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
41 }
42
43 @java.lang.Override
44 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.DecisionStrategyProto.class, com.google.ortools.sat.DecisionStrategyProto.Builder.class);
49 }
50
63 implements com.google.protobuf.ProtocolMessageEnum {
85 ;
86
90 public static final int CHOOSE_FIRST_VALUE = 0;
94 public static final int CHOOSE_LOWEST_MIN_VALUE = 1;
98 public static final int CHOOSE_HIGHEST_MAX_VALUE = 2;
102 public static final int CHOOSE_MIN_DOMAIN_SIZE_VALUE = 3;
106 public static final int CHOOSE_MAX_DOMAIN_SIZE_VALUE = 4;
107
108
109 public final int getNumber() {
110 if (this == UNRECOGNIZED) {
111 throw new java.lang.IllegalArgumentException(
112 "Can't get the number of an unknown enum value.");
113 }
114 return value;
115 }
116
122 @java.lang.Deprecated
123 public static VariableSelectionStrategy valueOf(int value) {
124 return forNumber(value);
125 }
126
131 public static VariableSelectionStrategy forNumber(int value) {
132 switch (value) {
133 case 0: return CHOOSE_FIRST;
134 case 1: return CHOOSE_LOWEST_MIN;
135 case 2: return CHOOSE_HIGHEST_MAX;
136 case 3: return CHOOSE_MIN_DOMAIN_SIZE;
137 case 4: return CHOOSE_MAX_DOMAIN_SIZE;
138 default: return null;
139 }
140 }
141
142 public static com.google.protobuf.Internal.EnumLiteMap<VariableSelectionStrategy>
144 return internalValueMap;
145 }
146 private static final com.google.protobuf.Internal.EnumLiteMap<
147 VariableSelectionStrategy> internalValueMap =
148 new com.google.protobuf.Internal.EnumLiteMap<VariableSelectionStrategy>() {
149 public VariableSelectionStrategy findValueByNumber(int number) {
151 }
152 };
153
154 public final com.google.protobuf.Descriptors.EnumValueDescriptor
156 if (this == UNRECOGNIZED) {
157 throw new java.lang.IllegalStateException(
158 "Can't get the descriptor of an unrecognized enum value.");
159 }
160 return getDescriptor().getValues().get(ordinal());
161 }
162 public final com.google.protobuf.Descriptors.EnumDescriptor
164 return getDescriptor();
165 }
166 public static final com.google.protobuf.Descriptors.EnumDescriptor
168 return com.google.ortools.sat.DecisionStrategyProto.getDescriptor().getEnumTypes().get(0);
169 }
170
171 private static final VariableSelectionStrategy[] VALUES = values();
172
174 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
175 if (desc.getType() != getDescriptor()) {
176 throw new java.lang.IllegalArgumentException(
177 "EnumValueDescriptor is not for this type.");
178 }
179 if (desc.getIndex() == -1) {
180 return UNRECOGNIZED;
181 }
182 return VALUES[desc.getIndex()];
183 }
184
185 private final int value;
186
187 private VariableSelectionStrategy(int value) {
188 this.value = value;
189 }
190
191 // @@protoc_insertion_point(enum_scope:operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy)
192 }
193
205 implements com.google.protobuf.ProtocolMessageEnum {
227 ;
228
232 public static final int SELECT_MIN_VALUE_VALUE = 0;
236 public static final int SELECT_MAX_VALUE_VALUE = 1;
240 public static final int SELECT_LOWER_HALF_VALUE = 2;
244 public static final int SELECT_UPPER_HALF_VALUE = 3;
248 public static final int SELECT_MEDIAN_VALUE_VALUE = 4;
249
250
251 public final int getNumber() {
252 if (this == UNRECOGNIZED) {
253 throw new java.lang.IllegalArgumentException(
254 "Can't get the number of an unknown enum value.");
255 }
256 return value;
257 }
258
264 @java.lang.Deprecated
265 public static DomainReductionStrategy valueOf(int value) {
266 return forNumber(value);
267 }
268
273 public static DomainReductionStrategy forNumber(int value) {
274 switch (value) {
275 case 0: return SELECT_MIN_VALUE;
276 case 1: return SELECT_MAX_VALUE;
277 case 2: return SELECT_LOWER_HALF;
278 case 3: return SELECT_UPPER_HALF;
279 case 4: return SELECT_MEDIAN_VALUE;
280 default: return null;
281 }
282 }
283
284 public static com.google.protobuf.Internal.EnumLiteMap<DomainReductionStrategy>
286 return internalValueMap;
287 }
288 private static final com.google.protobuf.Internal.EnumLiteMap<
289 DomainReductionStrategy> internalValueMap =
290 new com.google.protobuf.Internal.EnumLiteMap<DomainReductionStrategy>() {
291 public DomainReductionStrategy findValueByNumber(int number) {
292 return DomainReductionStrategy.forNumber(number);
293 }
294 };
295
296 public final com.google.protobuf.Descriptors.EnumValueDescriptor
298 if (this == UNRECOGNIZED) {
299 throw new java.lang.IllegalStateException(
300 "Can't get the descriptor of an unrecognized enum value.");
301 }
302 return getDescriptor().getValues().get(ordinal());
303 }
304 public final com.google.protobuf.Descriptors.EnumDescriptor
306 return getDescriptor();
307 }
308 public static final com.google.protobuf.Descriptors.EnumDescriptor
310 return com.google.ortools.sat.DecisionStrategyProto.getDescriptor().getEnumTypes().get(1);
311 }
312
313 private static final DomainReductionStrategy[] VALUES = values();
314
316 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
317 if (desc.getType() != getDescriptor()) {
318 throw new java.lang.IllegalArgumentException(
319 "EnumValueDescriptor is not for this type.");
320 }
321 if (desc.getIndex() == -1) {
322 return UNRECOGNIZED;
323 }
324 return VALUES[desc.getIndex()];
325 }
326
327 private final int value;
328
329 private DomainReductionStrategy(int value) {
330 this.value = value;
331 }
332
333 // @@protoc_insertion_point(enum_scope:operations_research.sat.DecisionStrategyProto.DomainReductionStrategy)
334 }
335
336 public static final int VARIABLES_FIELD_NUMBER = 1;
337 @SuppressWarnings("serial")
338 private com.google.protobuf.Internal.IntList variables_ =
339 emptyIntList();
350 @java.lang.Override
351 public java.util.List<java.lang.Integer>
353 return variables_;
354 }
365 public int getVariablesCount() {
366 return variables_.size();
367 }
379 public int getVariables(int index) {
380 return variables_.getInt(index);
381 }
382 private int variablesMemoizedSerializedSize = -1;
383
384 public static final int EXPRS_FIELD_NUMBER = 5;
385 @SuppressWarnings("serial")
386 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_;
399 @java.lang.Override
400 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getExprsList() {
401 return exprs_;
402 }
415 @java.lang.Override
416 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
418 return exprs_;
419 }
432 @java.lang.Override
433 public int getExprsCount() {
434 return exprs_.size();
435 }
448 @java.lang.Override
450 return exprs_.get(index);
451 }
464 @java.lang.Override
466 int index) {
467 return exprs_.get(index);
468 }
469
470 public static final int VARIABLE_SELECTION_STRATEGY_FIELD_NUMBER = 2;
471 private int variableSelectionStrategy_ = 0;
476 @java.lang.Override public int getVariableSelectionStrategyValue() {
477 return variableSelectionStrategy_;
478 }
484 com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy result = com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.forNumber(variableSelectionStrategy_);
485 return result == null ? com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.UNRECOGNIZED : result;
486 }
487
488 public static final int DOMAIN_REDUCTION_STRATEGY_FIELD_NUMBER = 3;
489 private int domainReductionStrategy_ = 0;
494 @java.lang.Override public int getDomainReductionStrategyValue() {
495 return domainReductionStrategy_;
496 }
502 com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy result = com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.forNumber(domainReductionStrategy_);
503 return result == null ? com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.UNRECOGNIZED : result;
504 }
505
506 private byte memoizedIsInitialized = -1;
507 @java.lang.Override
508 public final boolean isInitialized() {
509 byte isInitialized = memoizedIsInitialized;
510 if (isInitialized == 1) return true;
511 if (isInitialized == 0) return false;
512
513 memoizedIsInitialized = 1;
514 return true;
515 }
516
517 @java.lang.Override
518 public void writeTo(com.google.protobuf.CodedOutputStream output)
519 throws java.io.IOException {
521 if (getVariablesList().size() > 0) {
522 output.writeUInt32NoTag(10);
523 output.writeUInt32NoTag(variablesMemoizedSerializedSize);
524 }
525 for (int i = 0; i < variables_.size(); i++) {
526 output.writeInt32NoTag(variables_.getInt(i));
527 }
528 if (variableSelectionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.CHOOSE_FIRST.getNumber()) {
529 output.writeEnum(2, variableSelectionStrategy_);
530 }
531 if (domainReductionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.SELECT_MIN_VALUE.getNumber()) {
532 output.writeEnum(3, domainReductionStrategy_);
533 }
534 for (int i = 0; i < exprs_.size(); i++) {
535 output.writeMessage(5, exprs_.get(i));
536 }
537 getUnknownFields().writeTo(output);
538 }
539
540 @java.lang.Override
541 public int getSerializedSize() {
542 int size = memoizedSize;
543 if (size != -1) return size;
544
545 size = 0;
546 {
547 int dataSize = 0;
548 for (int i = 0; i < variables_.size(); i++) {
549 dataSize += com.google.protobuf.CodedOutputStream
550 .computeInt32SizeNoTag(variables_.getInt(i));
551 }
552 size += dataSize;
553 if (!getVariablesList().isEmpty()) {
554 size += 1;
555 size += com.google.protobuf.CodedOutputStream
556 .computeInt32SizeNoTag(dataSize);
557 }
558 variablesMemoizedSerializedSize = dataSize;
559 }
560 if (variableSelectionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.CHOOSE_FIRST.getNumber()) {
561 size += com.google.protobuf.CodedOutputStream
562 .computeEnumSize(2, variableSelectionStrategy_);
563 }
564 if (domainReductionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.SELECT_MIN_VALUE.getNumber()) {
565 size += com.google.protobuf.CodedOutputStream
566 .computeEnumSize(3, domainReductionStrategy_);
567 }
568 for (int i = 0; i < exprs_.size(); i++) {
569 size += com.google.protobuf.CodedOutputStream
570 .computeMessageSize(5, exprs_.get(i));
571 }
572 size += getUnknownFields().getSerializedSize();
573 memoizedSize = size;
574 return size;
575 }
576
577 @java.lang.Override
578 public boolean equals(final java.lang.Object obj) {
579 if (obj == this) {
580 return true;
581 }
582 if (!(obj instanceof com.google.ortools.sat.DecisionStrategyProto)) {
583 return super.equals(obj);
584 }
585 com.google.ortools.sat.DecisionStrategyProto other = (com.google.ortools.sat.DecisionStrategyProto) obj;
586
587 if (!getVariablesList()
588 .equals(other.getVariablesList())) return false;
589 if (!getExprsList()
590 .equals(other.getExprsList())) return false;
591 if (variableSelectionStrategy_ != other.variableSelectionStrategy_) return false;
592 if (domainReductionStrategy_ != other.domainReductionStrategy_) return false;
593 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
594 return true;
595 }
596
597 @java.lang.Override
598 public int hashCode() {
599 if (memoizedHashCode != 0) {
600 return memoizedHashCode;
601 }
602 int hash = 41;
603 hash = (19 * hash) + getDescriptor().hashCode();
604 if (getVariablesCount() > 0) {
605 hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
606 hash = (53 * hash) + getVariablesList().hashCode();
607 }
608 if (getExprsCount() > 0) {
609 hash = (37 * hash) + EXPRS_FIELD_NUMBER;
610 hash = (53 * hash) + getExprsList().hashCode();
611 }
612 hash = (37 * hash) + VARIABLE_SELECTION_STRATEGY_FIELD_NUMBER;
613 hash = (53 * hash) + variableSelectionStrategy_;
614 hash = (37 * hash) + DOMAIN_REDUCTION_STRATEGY_FIELD_NUMBER;
615 hash = (53 * hash) + domainReductionStrategy_;
616 hash = (29 * hash) + getUnknownFields().hashCode();
617 memoizedHashCode = hash;
618 return hash;
619 }
620
622 java.nio.ByteBuffer data)
623 throws com.google.protobuf.InvalidProtocolBufferException {
624 return PARSER.parseFrom(data);
625 }
627 java.nio.ByteBuffer data,
628 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
629 throws com.google.protobuf.InvalidProtocolBufferException {
630 return PARSER.parseFrom(data, extensionRegistry);
631 }
633 com.google.protobuf.ByteString data)
634 throws com.google.protobuf.InvalidProtocolBufferException {
635 return PARSER.parseFrom(data);
636 }
638 com.google.protobuf.ByteString data,
639 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
640 throws com.google.protobuf.InvalidProtocolBufferException {
641 return PARSER.parseFrom(data, extensionRegistry);
642 }
644 throws com.google.protobuf.InvalidProtocolBufferException {
645 return PARSER.parseFrom(data);
646 }
648 byte[] data,
649 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
650 throws com.google.protobuf.InvalidProtocolBufferException {
651 return PARSER.parseFrom(data, extensionRegistry);
652 }
653 public static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.io.InputStream input)
654 throws java.io.IOException {
655 return com.google.protobuf.GeneratedMessageV3
656 .parseWithIOException(PARSER, input);
657 }
659 java.io.InputStream input,
660 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
661 throws java.io.IOException {
662 return com.google.protobuf.GeneratedMessageV3
663 .parseWithIOException(PARSER, input, extensionRegistry);
664 }
665
667 throws java.io.IOException {
668 return com.google.protobuf.GeneratedMessageV3
669 .parseDelimitedWithIOException(PARSER, input);
670 }
671
673 java.io.InputStream input,
674 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
675 throws java.io.IOException {
676 return com.google.protobuf.GeneratedMessageV3
677 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
678 }
680 com.google.protobuf.CodedInputStream input)
681 throws java.io.IOException {
682 return com.google.protobuf.GeneratedMessageV3
683 .parseWithIOException(PARSER, input);
684 }
686 com.google.protobuf.CodedInputStream input,
687 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
688 throws java.io.IOException {
689 return com.google.protobuf.GeneratedMessageV3
690 .parseWithIOException(PARSER, input, extensionRegistry);
691 }
692
693 @java.lang.Override
694 public Builder newBuilderForType() { return newBuilder(); }
695 public static Builder newBuilder() {
696 return DEFAULT_INSTANCE.toBuilder();
697 }
698 public static Builder newBuilder(com.google.ortools.sat.DecisionStrategyProto prototype) {
699 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
700 }
701 @java.lang.Override
703 return this == DEFAULT_INSTANCE
704 ? new Builder() : new Builder().mergeFrom(this);
705 }
706
707 @java.lang.Override
709 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
710 Builder builder = new Builder(parent);
711 return builder;
712 }
721 public static final class Builder extends
722 com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
723 // @@protoc_insertion_point(builder_implements:operations_research.sat.DecisionStrategyProto)
724 com.google.ortools.sat.DecisionStrategyProtoOrBuilder {
725 public static final com.google.protobuf.Descriptors.Descriptor
727 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
728 }
729
730 @java.lang.Override
731 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
733 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_fieldAccessorTable
734 .ensureFieldAccessorsInitialized(
735 com.google.ortools.sat.DecisionStrategyProto.class, com.google.ortools.sat.DecisionStrategyProto.Builder.class);
736 }
737
738 // Construct using com.google.ortools.sat.DecisionStrategyProto.newBuilder()
739 private Builder() {
740
741 }
742
743 private Builder(
744 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
745 super(parent);
746
747 }
748 @java.lang.Override
749 public Builder clear() {
750 super.clear();
751 bitField0_ = 0;
752 variables_ = emptyIntList();
753 if (exprsBuilder_ == null) {
754 exprs_ = java.util.Collections.emptyList();
755 } else {
756 exprs_ = null;
757 exprsBuilder_.clear();
758 }
759 bitField0_ = (bitField0_ & ~0x00000002);
760 variableSelectionStrategy_ = 0;
761 domainReductionStrategy_ = 0;
762 return this;
763 }
764
765 @java.lang.Override
766 public com.google.protobuf.Descriptors.Descriptor
768 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
769 }
770
771 @java.lang.Override
773 return com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance();
774 }
775
776 @java.lang.Override
779 if (!result.isInitialized()) {
780 throw newUninitializedMessageException(result);
781 }
782 return result;
783 }
784
785 @java.lang.Override
787 com.google.ortools.sat.DecisionStrategyProto result = new com.google.ortools.sat.DecisionStrategyProto(this);
788 buildPartialRepeatedFields(result);
789 if (bitField0_ != 0) { buildPartial0(result); }
790 onBuilt();
791 return result;
792 }
793
794 private void buildPartialRepeatedFields(com.google.ortools.sat.DecisionStrategyProto result) {
795 if (exprsBuilder_ == null) {
796 if (((bitField0_ & 0x00000002) != 0)) {
797 exprs_ = java.util.Collections.unmodifiableList(exprs_);
798 bitField0_ = (bitField0_ & ~0x00000002);
799 }
800 result.exprs_ = exprs_;
801 } else {
802 result.exprs_ = exprsBuilder_.build();
803 }
804 }
805
806 private void buildPartial0(com.google.ortools.sat.DecisionStrategyProto result) {
807 int from_bitField0_ = bitField0_;
808 if (((from_bitField0_ & 0x00000001) != 0)) {
809 variables_.makeImmutable();
810 result.variables_ = variables_;
811 }
812 if (((from_bitField0_ & 0x00000004) != 0)) {
813 result.variableSelectionStrategy_ = variableSelectionStrategy_;
814 }
815 if (((from_bitField0_ & 0x00000008) != 0)) {
816 result.domainReductionStrategy_ = domainReductionStrategy_;
817 }
818 }
819
820 @java.lang.Override
821 public Builder clone() {
822 return super.clone();
823 }
824 @java.lang.Override
826 com.google.protobuf.Descriptors.FieldDescriptor field,
827 java.lang.Object value) {
828 return super.setField(field, value);
829 }
830 @java.lang.Override
832 com.google.protobuf.Descriptors.FieldDescriptor field) {
833 return super.clearField(field);
834 }
835 @java.lang.Override
837 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
838 return super.clearOneof(oneof);
839 }
840 @java.lang.Override
842 com.google.protobuf.Descriptors.FieldDescriptor field,
843 int index, java.lang.Object value) {
844 return super.setRepeatedField(field, index, value);
845 }
846 @java.lang.Override
848 com.google.protobuf.Descriptors.FieldDescriptor field,
849 java.lang.Object value) {
850 return super.addRepeatedField(field, value);
851 }
852 @java.lang.Override
853 public Builder mergeFrom(com.google.protobuf.Message other) {
854 if (other instanceof com.google.ortools.sat.DecisionStrategyProto) {
855 return mergeFrom((com.google.ortools.sat.DecisionStrategyProto)other);
856 } else {
857 super.mergeFrom(other);
858 return this;
859 }
860 }
861
862 public Builder mergeFrom(com.google.ortools.sat.DecisionStrategyProto other) {
863 if (other == com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance()) return this;
864 if (!other.variables_.isEmpty()) {
865 if (variables_.isEmpty()) {
866 variables_ = other.variables_;
867 variables_.makeImmutable();
868 bitField0_ |= 0x00000001;
869 } else {
870 ensureVariablesIsMutable();
871 variables_.addAll(other.variables_);
872 }
873 onChanged();
874 }
875 if (exprsBuilder_ == null) {
876 if (!other.exprs_.isEmpty()) {
877 if (exprs_.isEmpty()) {
878 exprs_ = other.exprs_;
879 bitField0_ = (bitField0_ & ~0x00000002);
880 } else {
881 ensureExprsIsMutable();
882 exprs_.addAll(other.exprs_);
883 }
884 onChanged();
885 }
886 } else {
887 if (!other.exprs_.isEmpty()) {
888 if (exprsBuilder_.isEmpty()) {
889 exprsBuilder_.dispose();
890 exprsBuilder_ = null;
891 exprs_ = other.exprs_;
892 bitField0_ = (bitField0_ & ~0x00000002);
893 exprsBuilder_ =
894 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
895 getExprsFieldBuilder() : null;
896 } else {
897 exprsBuilder_.addAllMessages(other.exprs_);
898 }
899 }
900 }
901 if (other.variableSelectionStrategy_ != 0) {
902 setVariableSelectionStrategyValue(other.getVariableSelectionStrategyValue());
903 }
904 if (other.domainReductionStrategy_ != 0) {
905 setDomainReductionStrategyValue(other.getDomainReductionStrategyValue());
906 }
907 this.mergeUnknownFields(other.getUnknownFields());
908 onChanged();
909 return this;
910 }
911
912 @java.lang.Override
913 public final boolean isInitialized() {
914 return true;
915 }
916
917 @java.lang.Override
919 com.google.protobuf.CodedInputStream input,
920 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
921 throws java.io.IOException {
922 if (extensionRegistry == null) {
923 throw new java.lang.NullPointerException();
924 }
925 try {
926 boolean done = false;
927 while (!done) {
928 int tag = input.readTag();
929 switch (tag) {
930 case 0:
931 done = true;
932 break;
933 case 8: {
934 int v = input.readInt32();
935 ensureVariablesIsMutable();
936 variables_.addInt(v);
937 break;
938 } // case 8
939 case 10: {
940 int length = input.readRawVarint32();
941 int limit = input.pushLimit(length);
942 ensureVariablesIsMutable();
943 while (input.getBytesUntilLimit() > 0) {
944 variables_.addInt(input.readInt32());
945 }
946 input.popLimit(limit);
947 break;
948 } // case 10
949 case 16: {
950 variableSelectionStrategy_ = input.readEnum();
951 bitField0_ |= 0x00000004;
952 break;
953 } // case 16
954 case 24: {
955 domainReductionStrategy_ = input.readEnum();
956 bitField0_ |= 0x00000008;
957 break;
958 } // case 24
959 case 42: {
961 input.readMessage(
962 com.google.ortools.sat.LinearExpressionProto.parser(),
963 extensionRegistry);
964 if (exprsBuilder_ == null) {
965 ensureExprsIsMutable();
966 exprs_.add(m);
967 } else {
968 exprsBuilder_.addMessage(m);
969 }
970 break;
971 } // case 42
972 default: {
973 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
974 done = true; // was an endgroup tag
975 }
976 break;
977 } // default:
978 } // switch (tag)
979 } // while (!done)
980 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
981 throw e.unwrapIOException();
982 } finally {
983 onChanged();
984 } // finally
985 return this;
986 }
987 private int bitField0_;
988
989 private com.google.protobuf.Internal.IntList variables_ = emptyIntList();
990 private void ensureVariablesIsMutable() {
991 if (!variables_.isModifiable()) {
992 variables_ = makeMutableCopy(variables_);
993 }
994 bitField0_ |= 0x00000001;
995 }
1006 public java.util.List<java.lang.Integer>
1008 variables_.makeImmutable();
1009 return variables_;
1010 }
1021 public int getVariablesCount() {
1022 return variables_.size();
1023 }
1035 public int getVariables(int index) {
1036 return variables_.getInt(index);
1037 }
1051 int index, int value) {
1052
1053 ensureVariablesIsMutable();
1054 variables_.setInt(index, value);
1055 bitField0_ |= 0x00000001;
1056 onChanged();
1057 return this;
1058 }
1070 public Builder addVariables(int value) {
1071
1072 ensureVariablesIsMutable();
1073 variables_.addInt(value);
1074 bitField0_ |= 0x00000001;
1075 onChanged();
1076 return this;
1077 }
1090 java.lang.Iterable<? extends java.lang.Integer> values) {
1091 ensureVariablesIsMutable();
1092 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1093 values, variables_);
1094 bitField0_ |= 0x00000001;
1095 onChanged();
1096 return this;
1097 }
1109 variables_ = emptyIntList();
1110 bitField0_ = (bitField0_ & ~0x00000001);
1111 onChanged();
1112 return this;
1113 }
1114
1115 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_ =
1116 java.util.Collections.emptyList();
1117 private void ensureExprsIsMutable() {
1118 if (!((bitField0_ & 0x00000002) != 0)) {
1119 exprs_ = new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(exprs_);
1120 bitField0_ |= 0x00000002;
1121 }
1122 }
1123
1124 private com.google.protobuf.RepeatedFieldBuilderV3<
1125 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> exprsBuilder_;
1126
1139 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getExprsList() {
1140 if (exprsBuilder_ == null) {
1141 return java.util.Collections.unmodifiableList(exprs_);
1142 } else {
1143 return exprsBuilder_.getMessageList();
1144 }
1145 }
1158 public int getExprsCount() {
1159 if (exprsBuilder_ == null) {
1160 return exprs_.size();
1161 } else {
1162 return exprsBuilder_.getCount();
1163 }
1164 }
1178 if (exprsBuilder_ == null) {
1179 return exprs_.get(index);
1180 } else {
1181 return exprsBuilder_.getMessage(index);
1182 }
1183 }
1197 int index, com.google.ortools.sat.LinearExpressionProto value) {
1198 if (exprsBuilder_ == null) {
1199 if (value == null) {
1200 throw new NullPointerException();
1201 }
1202 ensureExprsIsMutable();
1203 exprs_.set(index, value);
1204 onChanged();
1205 } else {
1206 exprsBuilder_.setMessage(index, value);
1207 }
1208 return this;
1209 }
1223 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1224 if (exprsBuilder_ == null) {
1225 ensureExprsIsMutable();
1226 exprs_.set(index, builderForValue.build());
1227 onChanged();
1228 } else {
1229 exprsBuilder_.setMessage(index, builderForValue.build());
1230 }
1231 return this;
1232 }
1245 public Builder addExprs(com.google.ortools.sat.LinearExpressionProto value) {
1246 if (exprsBuilder_ == null) {
1247 if (value == null) {
1248 throw new NullPointerException();
1249 }
1250 ensureExprsIsMutable();
1251 exprs_.add(value);
1252 onChanged();
1253 } else {
1254 exprsBuilder_.addMessage(value);
1255 }
1256 return this;
1257 }
1271 int index, com.google.ortools.sat.LinearExpressionProto value) {
1272 if (exprsBuilder_ == null) {
1273 if (value == null) {
1274 throw new NullPointerException();
1275 }
1276 ensureExprsIsMutable();
1277 exprs_.add(index, value);
1278 onChanged();
1279 } else {
1280 exprsBuilder_.addMessage(index, value);
1281 }
1282 return this;
1283 }
1297 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1298 if (exprsBuilder_ == null) {
1299 ensureExprsIsMutable();
1300 exprs_.add(builderForValue.build());
1301 onChanged();
1302 } else {
1303 exprsBuilder_.addMessage(builderForValue.build());
1304 }
1305 return this;
1306 }
1320 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1321 if (exprsBuilder_ == null) {
1322 ensureExprsIsMutable();
1323 exprs_.add(index, builderForValue.build());
1324 onChanged();
1325 } else {
1326 exprsBuilder_.addMessage(index, builderForValue.build());
1327 }
1328 return this;
1329 }
1343 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
1344 if (exprsBuilder_ == null) {
1345 ensureExprsIsMutable();
1346 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1347 values, exprs_);
1348 onChanged();
1349 } else {
1350 exprsBuilder_.addAllMessages(values);
1351 }
1352 return this;
1353 }
1367 if (exprsBuilder_ == null) {
1368 exprs_ = java.util.Collections.emptyList();
1369 bitField0_ = (bitField0_ & ~0x00000002);
1370 onChanged();
1371 } else {
1372 exprsBuilder_.clear();
1373 }
1374 return this;
1375 }
1388 public Builder removeExprs(int index) {
1389 if (exprsBuilder_ == null) {
1390 ensureExprsIsMutable();
1391 exprs_.remove(index);
1392 onChanged();
1393 } else {
1394 exprsBuilder_.remove(index);
1395 }
1396 return this;
1397 }
1411 int index) {
1412 return getExprsFieldBuilder().getBuilder(index);
1413 }
1427 int index) {
1428 if (exprsBuilder_ == null) {
1429 return exprs_.get(index); } else {
1430 return exprsBuilder_.getMessageOrBuilder(index);
1431 }
1432 }
1445 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1447 if (exprsBuilder_ != null) {
1448 return exprsBuilder_.getMessageOrBuilderList();
1449 } else {
1450 return java.util.Collections.unmodifiableList(exprs_);
1451 }
1452 }
1466 return getExprsFieldBuilder().addBuilder(
1467 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1468 }
1482 int index) {
1483 return getExprsFieldBuilder().addBuilder(
1484 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1485 }
1498 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
1500 return getExprsFieldBuilder().getBuilderList();
1501 }
1502 private com.google.protobuf.RepeatedFieldBuilderV3<
1503 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1504 getExprsFieldBuilder() {
1505 if (exprsBuilder_ == null) {
1506 exprsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1507 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
1508 exprs_,
1509 ((bitField0_ & 0x00000002) != 0),
1510 getParentForChildren(),
1511 isClean());
1512 exprs_ = null;
1513 }
1514 return exprsBuilder_;
1515 }
1516
1517 private int variableSelectionStrategy_ = 0;
1522 @java.lang.Override public int getVariableSelectionStrategyValue() {
1523 return variableSelectionStrategy_;
1524 }
1531 variableSelectionStrategy_ = value;
1532 bitField0_ |= 0x00000004;
1533 onChanged();
1534 return this;
1535 }
1540 @java.lang.Override
1542 com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy result = com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.forNumber(variableSelectionStrategy_);
1543 return result == null ? com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.UNRECOGNIZED : result;
1544 }
1550 public Builder setVariableSelectionStrategy(com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy value) {
1551 if (value == null) {
1552 throw new NullPointerException();
1553 }
1554 bitField0_ |= 0x00000004;
1555 variableSelectionStrategy_ = value.getNumber();
1556 onChanged();
1557 return this;
1558 }
1564 bitField0_ = (bitField0_ & ~0x00000004);
1565 variableSelectionStrategy_ = 0;
1566 onChanged();
1567 return this;
1568 }
1569
1570 private int domainReductionStrategy_ = 0;
1575 @java.lang.Override public int getDomainReductionStrategyValue() {
1576 return domainReductionStrategy_;
1577 }
1584 domainReductionStrategy_ = value;
1585 bitField0_ |= 0x00000008;
1586 onChanged();
1587 return this;
1588 }
1593 @java.lang.Override
1595 com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy result = com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.forNumber(domainReductionStrategy_);
1596 return result == null ? com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.UNRECOGNIZED : result;
1597 }
1603 public Builder setDomainReductionStrategy(com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy value) {
1604 if (value == null) {
1605 throw new NullPointerException();
1606 }
1607 bitField0_ |= 0x00000008;
1608 domainReductionStrategy_ = value.getNumber();
1609 onChanged();
1610 return this;
1611 }
1617 bitField0_ = (bitField0_ & ~0x00000008);
1618 domainReductionStrategy_ = 0;
1619 onChanged();
1620 return this;
1621 }
1622 @java.lang.Override
1624 final com.google.protobuf.UnknownFieldSet unknownFields) {
1625 return super.setUnknownFields(unknownFields);
1626 }
1627
1628 @java.lang.Override
1630 final com.google.protobuf.UnknownFieldSet unknownFields) {
1631 return super.mergeUnknownFields(unknownFields);
1632 }
1633
1634
1635 // @@protoc_insertion_point(builder_scope:operations_research.sat.DecisionStrategyProto)
1636 }
1637
1638 // @@protoc_insertion_point(class_scope:operations_research.sat.DecisionStrategyProto)
1639 private static final com.google.ortools.sat.DecisionStrategyProto DEFAULT_INSTANCE;
1640 static {
1641 DEFAULT_INSTANCE = new com.google.ortools.sat.DecisionStrategyProto();
1642 }
1643
1645 return DEFAULT_INSTANCE;
1646 }
1647
1648 private static final com.google.protobuf.Parser<DecisionStrategyProto>
1649 PARSER = new com.google.protobuf.AbstractParser<DecisionStrategyProto>() {
1650 @java.lang.Override
1651 public DecisionStrategyProto parsePartialFrom(
1652 com.google.protobuf.CodedInputStream input,
1653 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1654 throws com.google.protobuf.InvalidProtocolBufferException {
1655 Builder builder = newBuilder();
1656 try {
1657 builder.mergeFrom(input, extensionRegistry);
1658 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1659 throw e.setUnfinishedMessage(builder.buildPartial());
1660 } catch (com.google.protobuf.UninitializedMessageException e) {
1661 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1662 } catch (java.io.IOException e) {
1663 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1664 .setUnfinishedMessage(builder.buildPartial());
1665 }
1666 return builder.buildPartial();
1667 }
1668 };
1669
1670 public static com.google.protobuf.Parser<DecisionStrategyProto> parser() {
1671 return PARSER;
1672 }
1673
1674 @java.lang.Override
1675 public com.google.protobuf.Parser<DecisionStrategyProto> getParserForType() {
1676 return PARSER;
1677 }
1678
1679 @java.lang.Override
1681 return DEFAULT_INSTANCE;
1682 }
1683
1684}
1685
final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
Builder addAllVariables(java.lang.Iterable<? extends java.lang.Integer > values)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder addExprs(int index, com.google.ortools.sat.LinearExpressionProto value)
Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
Builder setExprs(int index, com.google.ortools.sat.LinearExpressionProto value)
com.google.ortools.sat.DecisionStrategyProto getDefaultInstanceForType()
Builder addExprs(com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
Builder addAllExprs(java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto > values)
com.google.ortools.sat.LinearExpressionProto getExprs(int index)
Builder setVariableSelectionStrategy(com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy value)
com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy getVariableSelectionStrategy()
com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy getDomainReductionStrategy()
final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
Builder setExprs(int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
com.google.ortools.sat.LinearExpressionProto.Builder addExprsBuilder()
Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder > getExprsOrBuilderList()
com.google.ortools.sat.LinearExpressionProtoOrBuilder getExprsOrBuilder(int index)
com.google.ortools.sat.LinearExpressionProto.Builder getExprsBuilder(int index)
Builder setDomainReductionStrategy(com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy value)
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder addExprs(com.google.ortools.sat.LinearExpressionProto value)
Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.sat.DecisionStrategyProto build()
java.util.List< com.google.ortools.sat.LinearExpressionProto.Builder > getExprsBuilderList()
Builder addExprs(int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
java.util.List< com.google.ortools.sat.LinearExpressionProto > getExprsList()
Builder mergeFrom(com.google.protobuf.Message other)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.LinearExpressionProto.Builder addExprsBuilder(int index)
Builder mergeFrom(com.google.ortools.sat.DecisionStrategyProto other)
com.google.ortools.sat.DecisionStrategyProto buildPartial()
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< DecisionStrategyProto > parser()
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
java.util.List< java.lang.Integer > getVariablesList()
java.lang.Object newInstance(UnusedPrivateParameter unused)
static com.google.ortools.sat.DecisionStrategyProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(com.google.protobuf.CodedInputStream input)
java.util.List< com.google.ortools.sat.LinearExpressionProto > getExprsList()
static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.io.InputStream input)
java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder > getExprsOrBuilderList()
static Builder newBuilder(com.google.ortools.sat.DecisionStrategyProto prototype)
com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy getDomainReductionStrategy()
com.google.ortools.sat.LinearExpressionProtoOrBuilder getExprsOrBuilder(int index)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(byte[] data)
com.google.protobuf.Parser< DecisionStrategyProto > getParserForType()
Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
static com.google.ortools.sat.DecisionStrategyProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.DecisionStrategyProto getDefaultInstance()
com.google.ortools.sat.LinearExpressionProto getExprs(int index)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.DecisionStrategyProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy getVariableSelectionStrategy()
com.google.ortools.sat.DecisionStrategyProto getDefaultInstanceForType()
static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
static DomainReductionStrategy valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
static com.google.protobuf.Internal.EnumLiteMap< DomainReductionStrategy > internalGetValueMap()
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
static com.google.protobuf.Internal.EnumLiteMap< VariableSelectionStrategy > internalGetValueMap()
static VariableSelectionStrategy valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()