Google OR-Tools v9.12
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// NO CHECKED-IN PROTOBUF GENCODE
3// source: ortools/sat/cp_model.proto
4// Protobuf Java Version: 4.29.3
5
6package com.google.ortools.sat;
7
16public final class DecisionStrategyProto extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.sat.DecisionStrategyProto)
20private static final long serialVersionUID = 0L;
21 static {
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
24 /* major= */ 4,
25 /* minor= */ 29,
26 /* patch= */ 3,
27 /* suffix= */ "",
28 DecisionStrategyProto.class.getName());
29 }
30 // Use DecisionStrategyProto.newBuilder() to construct.
31 private DecisionStrategyProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
34 private DecisionStrategyProto() {
35 variables_ = emptyIntList();
36 exprs_ = java.util.Collections.emptyList();
37 variableSelectionStrategy_ = 0;
38 domainReductionStrategy_ = 0;
39 }
40
41 public static final com.google.protobuf.Descriptors.Descriptor
43 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
44 }
45
46 @java.lang.Override
47 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
49 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_fieldAccessorTable
50 .ensureFieldAccessorsInitialized(
51 com.google.ortools.sat.DecisionStrategyProto.class, com.google.ortools.sat.DecisionStrategyProto.Builder.class);
52 }
53
65 public enum VariableSelectionStrategy
66 implements com.google.protobuf.ProtocolMessageEnum {
88 ;
89
90 static {
91 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
92 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
93 /* major= */ 4,
94 /* minor= */ 29,
95 /* patch= */ 3,
96 /* suffix= */ "",
97 VariableSelectionStrategy.class.getName());
98 }
102 public static final int CHOOSE_FIRST_VALUE = 0;
106 public static final int CHOOSE_LOWEST_MIN_VALUE = 1;
110 public static final int CHOOSE_HIGHEST_MAX_VALUE = 2;
114 public static final int CHOOSE_MIN_DOMAIN_SIZE_VALUE = 3;
118 public static final int CHOOSE_MAX_DOMAIN_SIZE_VALUE = 4;
119
120
121 public final int getNumber() {
122 if (this == UNRECOGNIZED) {
123 throw new java.lang.IllegalArgumentException(
124 "Can't get the number of an unknown enum value.");
125 }
126 return value;
127 }
128
134 @java.lang.Deprecated
135 public static VariableSelectionStrategy valueOf(int value) {
136 return forNumber(value);
137 }
138
143 public static VariableSelectionStrategy forNumber(int value) {
144 switch (value) {
145 case 0: return CHOOSE_FIRST;
146 case 1: return CHOOSE_LOWEST_MIN;
147 case 2: return CHOOSE_HIGHEST_MAX;
148 case 3: return CHOOSE_MIN_DOMAIN_SIZE;
149 case 4: return CHOOSE_MAX_DOMAIN_SIZE;
150 default: return null;
151 }
152 }
153
154 public static com.google.protobuf.Internal.EnumLiteMap<VariableSelectionStrategy>
156 return internalValueMap;
157 }
158 private static final com.google.protobuf.Internal.EnumLiteMap<
159 VariableSelectionStrategy> internalValueMap =
160 new com.google.protobuf.Internal.EnumLiteMap<VariableSelectionStrategy>() {
161 public VariableSelectionStrategy findValueByNumber(int number) {
163 }
164 };
165
166 public final com.google.protobuf.Descriptors.EnumValueDescriptor
168 if (this == UNRECOGNIZED) {
169 throw new java.lang.IllegalStateException(
170 "Can't get the descriptor of an unrecognized enum value.");
171 }
172 return getDescriptor().getValues().get(ordinal());
173 }
174 public final com.google.protobuf.Descriptors.EnumDescriptor
176 return getDescriptor();
177 }
178 public static final com.google.protobuf.Descriptors.EnumDescriptor
180 return com.google.ortools.sat.DecisionStrategyProto.getDescriptor().getEnumTypes().get(0);
181 }
182
183 private static final VariableSelectionStrategy[] VALUES = values();
184
185 public static VariableSelectionStrategy valueOf(
186 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
187 if (desc.getType() != getDescriptor()) {
188 throw new java.lang.IllegalArgumentException(
189 "EnumValueDescriptor is not for this type.");
190 }
191 if (desc.getIndex() == -1) {
192 return UNRECOGNIZED;
193 }
194 return VALUES[desc.getIndex()];
195 }
196
197 private final int value;
198
199 private VariableSelectionStrategy(int value) {
200 this.value = value;
201 }
202
203 // @@protoc_insertion_point(enum_scope:operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy)
204 }
205
216 public enum DomainReductionStrategy
217 implements com.google.protobuf.ProtocolMessageEnum {
243 ;
244
245 static {
246 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
247 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
248 /* major= */ 4,
249 /* minor= */ 29,
250 /* patch= */ 3,
251 /* suffix= */ "",
252 DomainReductionStrategy.class.getName());
253 }
257 public static final int SELECT_MIN_VALUE_VALUE = 0;
261 public static final int SELECT_MAX_VALUE_VALUE = 1;
265 public static final int SELECT_LOWER_HALF_VALUE = 2;
269 public static final int SELECT_UPPER_HALF_VALUE = 3;
273 public static final int SELECT_MEDIAN_VALUE_VALUE = 4;
277 public static final int SELECT_RANDOM_HALF_VALUE = 5;
278
279
280 public final int getNumber() {
281 if (this == UNRECOGNIZED) {
282 throw new java.lang.IllegalArgumentException(
283 "Can't get the number of an unknown enum value.");
284 }
285 return value;
286 }
287
293 @java.lang.Deprecated
294 public static DomainReductionStrategy valueOf(int value) {
295 return forNumber(value);
296 }
297
302 public static DomainReductionStrategy forNumber(int value) {
303 switch (value) {
304 case 0: return SELECT_MIN_VALUE;
305 case 1: return SELECT_MAX_VALUE;
306 case 2: return SELECT_LOWER_HALF;
307 case 3: return SELECT_UPPER_HALF;
308 case 4: return SELECT_MEDIAN_VALUE;
309 case 5: return SELECT_RANDOM_HALF;
310 default: return null;
311 }
312 }
313
314 public static com.google.protobuf.Internal.EnumLiteMap<DomainReductionStrategy>
316 return internalValueMap;
317 }
318 private static final com.google.protobuf.Internal.EnumLiteMap<
319 DomainReductionStrategy> internalValueMap =
320 new com.google.protobuf.Internal.EnumLiteMap<DomainReductionStrategy>() {
321 public DomainReductionStrategy findValueByNumber(int number) {
322 return DomainReductionStrategy.forNumber(number);
323 }
324 };
325
326 public final com.google.protobuf.Descriptors.EnumValueDescriptor
328 if (this == UNRECOGNIZED) {
329 throw new java.lang.IllegalStateException(
330 "Can't get the descriptor of an unrecognized enum value.");
331 }
332 return getDescriptor().getValues().get(ordinal());
333 }
334 public final com.google.protobuf.Descriptors.EnumDescriptor
336 return getDescriptor();
337 }
338 public static final com.google.protobuf.Descriptors.EnumDescriptor
340 return com.google.ortools.sat.DecisionStrategyProto.getDescriptor().getEnumTypes().get(1);
341 }
342
343 private static final DomainReductionStrategy[] VALUES = values();
344
345 public static DomainReductionStrategy valueOf(
346 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
347 if (desc.getType() != getDescriptor()) {
348 throw new java.lang.IllegalArgumentException(
349 "EnumValueDescriptor is not for this type.");
350 }
351 if (desc.getIndex() == -1) {
352 return UNRECOGNIZED;
353 }
354 return VALUES[desc.getIndex()];
355 }
356
357 private final int value;
358
359 private DomainReductionStrategy(int value) {
360 this.value = value;
361 }
362
363 // @@protoc_insertion_point(enum_scope:operations_research.sat.DecisionStrategyProto.DomainReductionStrategy)
364 }
365
366 public static final int VARIABLES_FIELD_NUMBER = 1;
367 @SuppressWarnings("serial")
368 private com.google.protobuf.Internal.IntList variables_ =
369 emptyIntList();
380 @java.lang.Override
381 public java.util.List<java.lang.Integer>
383 return variables_;
384 }
385
395 public int getVariablesCount() {
396 return variables_.size();
397 }
398
409 public int getVariables(int index) {
410 return variables_.getInt(index);
411 }
412 private int variablesMemoizedSerializedSize = -1;
413
414 public static final int EXPRS_FIELD_NUMBER = 5;
415 @SuppressWarnings("serial")
416 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_;
429 @java.lang.Override
430 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getExprsList() {
431 return exprs_;
432 }
433
445 @java.lang.Override
446 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
448 return exprs_;
449 }
450
462 @java.lang.Override
463 public int getExprsCount() {
464 return exprs_.size();
465 }
466
478 @java.lang.Override
480 return exprs_.get(index);
481 }
482
494 @java.lang.Override
496 int index) {
497 return exprs_.get(index);
498 }
499
500 public static final int VARIABLE_SELECTION_STRATEGY_FIELD_NUMBER = 2;
501 private int variableSelectionStrategy_ = 0;
506 @java.lang.Override public int getVariableSelectionStrategyValue() {
507 return variableSelectionStrategy_;
508 }
509
514 com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy result = com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.forNumber(variableSelectionStrategy_);
516 }
517
518 public static final int DOMAIN_REDUCTION_STRATEGY_FIELD_NUMBER = 3;
519 private int domainReductionStrategy_ = 0;
524 @java.lang.Override public int getDomainReductionStrategyValue() {
525 return domainReductionStrategy_;
526 }
527
532 com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy result = com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.forNumber(domainReductionStrategy_);
534 }
535
536 private byte memoizedIsInitialized = -1;
537 @java.lang.Override
538 public final boolean isInitialized() {
539 byte isInitialized = memoizedIsInitialized;
540 if (isInitialized == 1) return true;
541 if (isInitialized == 0) return false;
542
543 memoizedIsInitialized = 1;
544 return true;
545 }
546
547 @java.lang.Override
548 public void writeTo(com.google.protobuf.CodedOutputStream output)
549 throws java.io.IOException {
551 if (getVariablesList().size() > 0) {
552 output.writeUInt32NoTag(10);
553 output.writeUInt32NoTag(variablesMemoizedSerializedSize);
554 }
555 for (int i = 0; i < variables_.size(); i++) {
556 output.writeInt32NoTag(variables_.getInt(i));
557 }
558 if (variableSelectionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.CHOOSE_FIRST.getNumber()) {
559 output.writeEnum(2, variableSelectionStrategy_);
560 }
561 if (domainReductionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.SELECT_MIN_VALUE.getNumber()) {
562 output.writeEnum(3, domainReductionStrategy_);
563 }
564 for (int i = 0; i < exprs_.size(); i++) {
565 output.writeMessage(5, exprs_.get(i));
566 }
567 getUnknownFields().writeTo(output);
568 }
569
570 @java.lang.Override
571 public int getSerializedSize() {
572 int size = memoizedSize;
573 if (size != -1) return size;
574
575 size = 0;
576 {
577 int dataSize = 0;
578 for (int i = 0; i < variables_.size(); i++) {
579 dataSize += com.google.protobuf.CodedOutputStream
580 .computeInt32SizeNoTag(variables_.getInt(i));
581 }
582 size += dataSize;
583 if (!getVariablesList().isEmpty()) {
584 size += 1;
585 size += com.google.protobuf.CodedOutputStream
586 .computeInt32SizeNoTag(dataSize);
587 }
588 variablesMemoizedSerializedSize = dataSize;
589 }
590 if (variableSelectionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.CHOOSE_FIRST.getNumber()) {
591 size += com.google.protobuf.CodedOutputStream
592 .computeEnumSize(2, variableSelectionStrategy_);
593 }
594 if (domainReductionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.SELECT_MIN_VALUE.getNumber()) {
595 size += com.google.protobuf.CodedOutputStream
596 .computeEnumSize(3, domainReductionStrategy_);
597 }
598 for (int i = 0; i < exprs_.size(); i++) {
599 size += com.google.protobuf.CodedOutputStream
600 .computeMessageSize(5, exprs_.get(i));
601 }
602 size += getUnknownFields().getSerializedSize();
603 memoizedSize = size;
604 return size;
605 }
606
607 @java.lang.Override
608 public boolean equals(final java.lang.Object obj) {
609 if (obj == this) {
610 return true;
611 }
612 if (!(obj instanceof com.google.ortools.sat.DecisionStrategyProto)) {
613 return super.equals(obj);
614 }
615 com.google.ortools.sat.DecisionStrategyProto other = (com.google.ortools.sat.DecisionStrategyProto) obj;
616
617 if (!getVariablesList()
618 .equals(other.getVariablesList())) return false;
619 if (!getExprsList()
620 .equals(other.getExprsList())) return false;
621 if (variableSelectionStrategy_ != other.variableSelectionStrategy_) return false;
622 if (domainReductionStrategy_ != other.domainReductionStrategy_) return false;
623 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
624 return true;
625 }
626
627 @java.lang.Override
628 public int hashCode() {
629 if (memoizedHashCode != 0) {
630 return memoizedHashCode;
631 }
632 int hash = 41;
633 hash = (19 * hash) + getDescriptor().hashCode();
634 if (getVariablesCount() > 0) {
635 hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
636 hash = (53 * hash) + getVariablesList().hashCode();
637 }
638 if (getExprsCount() > 0) {
639 hash = (37 * hash) + EXPRS_FIELD_NUMBER;
640 hash = (53 * hash) + getExprsList().hashCode();
641 }
642 hash = (37 * hash) + VARIABLE_SELECTION_STRATEGY_FIELD_NUMBER;
643 hash = (53 * hash) + variableSelectionStrategy_;
644 hash = (37 * hash) + DOMAIN_REDUCTION_STRATEGY_FIELD_NUMBER;
645 hash = (53 * hash) + domainReductionStrategy_;
646 hash = (29 * hash) + getUnknownFields().hashCode();
647 memoizedHashCode = hash;
648 return hash;
649 }
650
652 java.nio.ByteBuffer data)
653 throws com.google.protobuf.InvalidProtocolBufferException {
654 return PARSER.parseFrom(data);
655 }
657 java.nio.ByteBuffer data,
658 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
659 throws com.google.protobuf.InvalidProtocolBufferException {
660 return PARSER.parseFrom(data, extensionRegistry);
661 }
663 com.google.protobuf.ByteString data)
664 throws com.google.protobuf.InvalidProtocolBufferException {
665 return PARSER.parseFrom(data);
666 }
668 com.google.protobuf.ByteString data,
669 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
670 throws com.google.protobuf.InvalidProtocolBufferException {
671 return PARSER.parseFrom(data, extensionRegistry);
672 }
674 throws com.google.protobuf.InvalidProtocolBufferException {
675 return PARSER.parseFrom(data);
676 }
678 byte[] data,
679 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
680 throws com.google.protobuf.InvalidProtocolBufferException {
681 return PARSER.parseFrom(data, extensionRegistry);
682 }
683 public static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.io.InputStream input)
684 throws java.io.IOException {
685 return com.google.protobuf.GeneratedMessage
686 .parseWithIOException(PARSER, input);
687 }
689 java.io.InputStream input,
690 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
691 throws java.io.IOException {
692 return com.google.protobuf.GeneratedMessage
693 .parseWithIOException(PARSER, input, extensionRegistry);
694 }
695
697 throws java.io.IOException {
698 return com.google.protobuf.GeneratedMessage
699 .parseDelimitedWithIOException(PARSER, input);
700 }
701
703 java.io.InputStream input,
704 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
705 throws java.io.IOException {
706 return com.google.protobuf.GeneratedMessage
707 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
708 }
710 com.google.protobuf.CodedInputStream input)
711 throws java.io.IOException {
712 return com.google.protobuf.GeneratedMessage
713 .parseWithIOException(PARSER, input);
714 }
716 com.google.protobuf.CodedInputStream input,
717 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
718 throws java.io.IOException {
719 return com.google.protobuf.GeneratedMessage
720 .parseWithIOException(PARSER, input, extensionRegistry);
721 }
722
723 @java.lang.Override
724 public Builder newBuilderForType() { return newBuilder(); }
725 public static Builder newBuilder() {
726 return DEFAULT_INSTANCE.toBuilder();
727 }
728 public static Builder newBuilder(com.google.ortools.sat.DecisionStrategyProto prototype) {
729 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
730 }
731 @java.lang.Override
733 return this == DEFAULT_INSTANCE
734 ? new Builder() : new Builder().mergeFrom(this);
735 }
736
737 @java.lang.Override
739 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
740 Builder builder = new Builder(parent);
741 return builder;
742 }
743
751 public static final class Builder extends
752 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
753 // @@protoc_insertion_point(builder_implements:operations_research.sat.DecisionStrategyProto)
755 public static final com.google.protobuf.Descriptors.Descriptor
757 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
758 }
759
760 @java.lang.Override
761 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
763 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_fieldAccessorTable
764 .ensureFieldAccessorsInitialized(
765 com.google.ortools.sat.DecisionStrategyProto.class, com.google.ortools.sat.DecisionStrategyProto.Builder.class);
766 }
767
768 // Construct using com.google.ortools.sat.DecisionStrategyProto.newBuilder()
769 private Builder() {
770
771 }
772
773 private Builder(
774 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
775 super(parent);
776
777 }
778 @java.lang.Override
779 public Builder clear() {
780 super.clear();
781 bitField0_ = 0;
782 variables_ = emptyIntList();
783 if (exprsBuilder_ == null) {
784 exprs_ = java.util.Collections.emptyList();
785 } else {
786 exprs_ = null;
787 exprsBuilder_.clear();
788 }
789 bitField0_ = (bitField0_ & ~0x00000002);
790 variableSelectionStrategy_ = 0;
791 domainReductionStrategy_ = 0;
792 return this;
793 }
794
795 @java.lang.Override
796 public com.google.protobuf.Descriptors.Descriptor
798 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
799 }
800
801 @java.lang.Override
803 return com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance();
804 }
805
806 @java.lang.Override
809 if (!result.isInitialized()) {
810 throw newUninitializedMessageException(result);
811 }
812 return result;
813 }
814
815 @java.lang.Override
817 com.google.ortools.sat.DecisionStrategyProto result = new com.google.ortools.sat.DecisionStrategyProto(this);
818 buildPartialRepeatedFields(result);
819 if (bitField0_ != 0) { buildPartial0(result); }
820 onBuilt();
821 return result;
822 }
823
824 private void buildPartialRepeatedFields(com.google.ortools.sat.DecisionStrategyProto result) {
825 if (exprsBuilder_ == null) {
826 if (((bitField0_ & 0x00000002) != 0)) {
827 exprs_ = java.util.Collections.unmodifiableList(exprs_);
828 bitField0_ = (bitField0_ & ~0x00000002);
829 }
830 result.exprs_ = exprs_;
831 } else {
832 result.exprs_ = exprsBuilder_.build();
833 }
834 }
835
836 private void buildPartial0(com.google.ortools.sat.DecisionStrategyProto result) {
837 int from_bitField0_ = bitField0_;
838 if (((from_bitField0_ & 0x00000001) != 0)) {
839 variables_.makeImmutable();
840 result.variables_ = variables_;
841 }
842 if (((from_bitField0_ & 0x00000004) != 0)) {
843 result.variableSelectionStrategy_ = variableSelectionStrategy_;
844 }
845 if (((from_bitField0_ & 0x00000008) != 0)) {
846 result.domainReductionStrategy_ = domainReductionStrategy_;
847 }
848 }
849
850 @java.lang.Override
851 public Builder mergeFrom(com.google.protobuf.Message other) {
852 if (other instanceof com.google.ortools.sat.DecisionStrategyProto) {
853 return mergeFrom((com.google.ortools.sat.DecisionStrategyProto)other);
854 } else {
855 super.mergeFrom(other);
856 return this;
857 }
858 }
859
860 public Builder mergeFrom(com.google.ortools.sat.DecisionStrategyProto other) {
861 if (other == com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance()) return this;
862 if (!other.variables_.isEmpty()) {
863 if (variables_.isEmpty()) {
864 variables_ = other.variables_;
865 variables_.makeImmutable();
866 bitField0_ |= 0x00000001;
867 } else {
868 ensureVariablesIsMutable();
869 variables_.addAll(other.variables_);
870 }
871 onChanged();
872 }
873 if (exprsBuilder_ == null) {
874 if (!other.exprs_.isEmpty()) {
875 if (exprs_.isEmpty()) {
876 exprs_ = other.exprs_;
877 bitField0_ = (bitField0_ & ~0x00000002);
878 } else {
879 ensureExprsIsMutable();
880 exprs_.addAll(other.exprs_);
881 }
882 onChanged();
883 }
884 } else {
885 if (!other.exprs_.isEmpty()) {
886 if (exprsBuilder_.isEmpty()) {
887 exprsBuilder_.dispose();
888 exprsBuilder_ = null;
889 exprs_ = other.exprs_;
890 bitField0_ = (bitField0_ & ~0x00000002);
891 exprsBuilder_ =
892 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
893 getExprsFieldBuilder() : null;
894 } else {
895 exprsBuilder_.addAllMessages(other.exprs_);
896 }
897 }
898 }
899 if (other.variableSelectionStrategy_ != 0) {
900 setVariableSelectionStrategyValue(other.getVariableSelectionStrategyValue());
901 }
902 if (other.domainReductionStrategy_ != 0) {
903 setDomainReductionStrategyValue(other.getDomainReductionStrategyValue());
904 }
905 this.mergeUnknownFields(other.getUnknownFields());
906 onChanged();
907 return this;
908 }
909
910 @java.lang.Override
911 public final boolean isInitialized() {
912 return true;
913 }
914
915 @java.lang.Override
916 public Builder mergeFrom(
917 com.google.protobuf.CodedInputStream input,
918 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
919 throws java.io.IOException {
920 if (extensionRegistry == null) {
921 throw new java.lang.NullPointerException();
922 }
923 try {
924 boolean done = false;
925 while (!done) {
926 int tag = input.readTag();
927 switch (tag) {
928 case 0:
929 done = true;
930 break;
931 case 8: {
932 int v = input.readInt32();
933 ensureVariablesIsMutable();
934 variables_.addInt(v);
935 break;
936 } // case 8
937 case 10: {
938 int length = input.readRawVarint32();
939 int limit = input.pushLimit(length);
940 ensureVariablesIsMutable();
941 while (input.getBytesUntilLimit() > 0) {
942 variables_.addInt(input.readInt32());
943 }
944 input.popLimit(limit);
945 break;
946 } // case 10
947 case 16: {
948 variableSelectionStrategy_ = input.readEnum();
949 bitField0_ |= 0x00000004;
950 break;
951 } // case 16
952 case 24: {
953 domainReductionStrategy_ = input.readEnum();
954 bitField0_ |= 0x00000008;
955 break;
956 } // case 24
957 case 42: {
959 input.readMessage(
960 com.google.ortools.sat.LinearExpressionProto.parser(),
961 extensionRegistry);
962 if (exprsBuilder_ == null) {
963 ensureExprsIsMutable();
964 exprs_.add(m);
965 } else {
966 exprsBuilder_.addMessage(m);
967 }
968 break;
969 } // case 42
970 default: {
971 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
972 done = true; // was an endgroup tag
973 }
974 break;
975 } // default:
976 } // switch (tag)
977 } // while (!done)
978 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
979 throw e.unwrapIOException();
980 } finally {
981 onChanged();
982 } // finally
983 return this;
984 }
985 private int bitField0_;
986
987 private com.google.protobuf.Internal.IntList variables_ = emptyIntList();
988 private void ensureVariablesIsMutable() {
989 if (!variables_.isModifiable()) {
990 variables_ = makeMutableCopy(variables_);
991 }
992 bitField0_ |= 0x00000001;
993 }
1004 public java.util.List<java.lang.Integer>
1006 variables_.makeImmutable();
1007 return variables_;
1008 }
1009
1019 public int getVariablesCount() {
1020 return variables_.size();
1021 }
1022
1033 public int getVariables(int index) {
1034 return variables_.getInt(index);
1035 }
1036
1048 public Builder setVariables(
1049 int index, int value) {
1050
1051 ensureVariablesIsMutable();
1052 variables_.setInt(index, value);
1053 bitField0_ |= 0x00000001;
1054 onChanged();
1055 return this;
1056 }
1057
1068 public Builder addVariables(int value) {
1069
1070 ensureVariablesIsMutable();
1071 variables_.addInt(value);
1072 bitField0_ |= 0x00000001;
1073 onChanged();
1074 return this;
1075 }
1076
1087 public Builder addAllVariables(
1088 java.lang.Iterable<? extends java.lang.Integer> values) {
1089 ensureVariablesIsMutable();
1090 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1091 values, variables_);
1092 bitField0_ |= 0x00000001;
1093 onChanged();
1094 return this;
1095 }
1096
1106 public Builder clearVariables() {
1107 variables_ = emptyIntList();
1108 bitField0_ = (bitField0_ & ~0x00000001);
1109 onChanged();
1110 return this;
1111 }
1112
1113 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_ =
1114 java.util.Collections.emptyList();
1115 private void ensureExprsIsMutable() {
1116 if (!((bitField0_ & 0x00000002) != 0)) {
1117 exprs_ = new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(exprs_);
1118 bitField0_ |= 0x00000002;
1119 }
1120 }
1121
1122 private com.google.protobuf.RepeatedFieldBuilder<
1123 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> exprsBuilder_;
1124
1137 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getExprsList() {
1138 if (exprsBuilder_ == null) {
1139 return java.util.Collections.unmodifiableList(exprs_);
1140 } else {
1141 return exprsBuilder_.getMessageList();
1142 }
1143 }
1144
1156 public int getExprsCount() {
1157 if (exprsBuilder_ == null) {
1158 return exprs_.size();
1159 } else {
1160 return exprsBuilder_.getCount();
1161 }
1162 }
1163
1176 if (exprsBuilder_ == null) {
1177 return exprs_.get(index);
1178 } else {
1179 return exprsBuilder_.getMessage(index);
1180 }
1181 }
1182
1194 public Builder setExprs(
1195 int index, com.google.ortools.sat.LinearExpressionProto value) {
1196 if (exprsBuilder_ == null) {
1197 if (value == null) {
1198 throw new NullPointerException();
1199 }
1200 ensureExprsIsMutable();
1201 exprs_.set(index, value);
1202 onChanged();
1203 } else {
1204 exprsBuilder_.setMessage(index, value);
1205 }
1206 return this;
1207 }
1208
1220 public Builder setExprs(
1221 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1222 if (exprsBuilder_ == null) {
1223 ensureExprsIsMutable();
1224 exprs_.set(index, builderForValue.build());
1225 onChanged();
1226 } else {
1227 exprsBuilder_.setMessage(index, builderForValue.build());
1228 }
1229 return this;
1230 }
1231
1243 public Builder addExprs(com.google.ortools.sat.LinearExpressionProto value) {
1244 if (exprsBuilder_ == null) {
1245 if (value == null) {
1246 throw new NullPointerException();
1247 }
1248 ensureExprsIsMutable();
1249 exprs_.add(value);
1250 onChanged();
1251 } else {
1252 exprsBuilder_.addMessage(value);
1253 }
1254 return this;
1255 }
1256
1268 public Builder addExprs(
1269 int index, com.google.ortools.sat.LinearExpressionProto value) {
1270 if (exprsBuilder_ == null) {
1271 if (value == null) {
1272 throw new NullPointerException();
1273 }
1274 ensureExprsIsMutable();
1275 exprs_.add(index, value);
1276 onChanged();
1277 } else {
1278 exprsBuilder_.addMessage(index, value);
1279 }
1280 return this;
1281 }
1282
1294 public Builder addExprs(
1295 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1296 if (exprsBuilder_ == null) {
1297 ensureExprsIsMutable();
1298 exprs_.add(builderForValue.build());
1299 onChanged();
1300 } else {
1301 exprsBuilder_.addMessage(builderForValue.build());
1302 }
1303 return this;
1304 }
1305
1317 public Builder addExprs(
1318 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1319 if (exprsBuilder_ == null) {
1320 ensureExprsIsMutable();
1321 exprs_.add(index, builderForValue.build());
1322 onChanged();
1323 } else {
1324 exprsBuilder_.addMessage(index, builderForValue.build());
1325 }
1326 return this;
1327 }
1328
1340 public Builder addAllExprs(
1341 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
1342 if (exprsBuilder_ == null) {
1343 ensureExprsIsMutable();
1344 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1345 values, exprs_);
1346 onChanged();
1347 } else {
1348 exprsBuilder_.addAllMessages(values);
1349 }
1350 return this;
1351 }
1352
1364 public Builder clearExprs() {
1365 if (exprsBuilder_ == null) {
1366 exprs_ = java.util.Collections.emptyList();
1367 bitField0_ = (bitField0_ & ~0x00000002);
1368 onChanged();
1369 } else {
1370 exprsBuilder_.clear();
1371 }
1372 return this;
1373 }
1374
1386 public Builder removeExprs(int index) {
1387 if (exprsBuilder_ == null) {
1388 ensureExprsIsMutable();
1389 exprs_.remove(index);
1390 onChanged();
1391 } else {
1392 exprsBuilder_.remove(index);
1393 }
1394 return this;
1395 }
1396
1409 int index) {
1410 return getExprsFieldBuilder().getBuilder(index);
1411 }
1412
1425 int index) {
1426 if (exprsBuilder_ == null) {
1427 return exprs_.get(index); } else {
1428 return exprsBuilder_.getMessageOrBuilder(index);
1429 }
1430 }
1431
1443 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1445 if (exprsBuilder_ != null) {
1446 return exprsBuilder_.getMessageOrBuilderList();
1447 } else {
1448 return java.util.Collections.unmodifiableList(exprs_);
1449 }
1450 }
1451
1464 return getExprsFieldBuilder().addBuilder(
1465 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1466 }
1467
1480 int index) {
1481 return getExprsFieldBuilder().addBuilder(
1482 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1483 }
1484
1496 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
1498 return getExprsFieldBuilder().getBuilderList();
1499 }
1500 private com.google.protobuf.RepeatedFieldBuilder<
1501 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1502 getExprsFieldBuilder() {
1503 if (exprsBuilder_ == null) {
1504 exprsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
1505 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
1506 exprs_,
1507 ((bitField0_ & 0x00000002) != 0),
1508 getParentForChildren(),
1509 isClean());
1510 exprs_ = null;
1511 }
1512 return exprsBuilder_;
1513 }
1514
1515 private int variableSelectionStrategy_ = 0;
1520 @java.lang.Override public int getVariableSelectionStrategyValue() {
1521 return variableSelectionStrategy_;
1522 }
1523
1528 public Builder setVariableSelectionStrategyValue(int value) {
1529 variableSelectionStrategy_ = value;
1530 bitField0_ |= 0x00000004;
1531 onChanged();
1532 return this;
1533 }
1534
1538 @java.lang.Override
1540 com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy result = com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.forNumber(variableSelectionStrategy_);
1542 }
1543
1548 public Builder setVariableSelectionStrategy(com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy value) {
1549 if (value == null) {
1550 throw new NullPointerException();
1551 }
1552 bitField0_ |= 0x00000004;
1553 variableSelectionStrategy_ = value.getNumber();
1554 onChanged();
1555 return this;
1556 }
1557
1562 bitField0_ = (bitField0_ & ~0x00000004);
1563 variableSelectionStrategy_ = 0;
1564 onChanged();
1565 return this;
1566 }
1567
1568 private int domainReductionStrategy_ = 0;
1573 @java.lang.Override public int getDomainReductionStrategyValue() {
1574 return domainReductionStrategy_;
1575 }
1576
1581 public Builder setDomainReductionStrategyValue(int value) {
1582 domainReductionStrategy_ = value;
1583 bitField0_ |= 0x00000008;
1584 onChanged();
1585 return this;
1586 }
1587
1591 @java.lang.Override
1593 com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy result = com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.forNumber(domainReductionStrategy_);
1595 }
1596
1601 public Builder setDomainReductionStrategy(com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy value) {
1602 if (value == null) {
1603 throw new NullPointerException();
1604 }
1605 bitField0_ |= 0x00000008;
1606 domainReductionStrategy_ = value.getNumber();
1607 onChanged();
1608 return this;
1609 }
1610
1615 bitField0_ = (bitField0_ & ~0x00000008);
1616 domainReductionStrategy_ = 0;
1617 onChanged();
1618 return this;
1619 }
1620
1621 // @@protoc_insertion_point(builder_scope:operations_research.sat.DecisionStrategyProto)
1622 }
1623
1624 // @@protoc_insertion_point(class_scope:operations_research.sat.DecisionStrategyProto)
1625 private static final com.google.ortools.sat.DecisionStrategyProto DEFAULT_INSTANCE;
1626 static {
1627 DEFAULT_INSTANCE = new com.google.ortools.sat.DecisionStrategyProto();
1628 }
1629
1631 return DEFAULT_INSTANCE;
1632 }
1633
1634 private static final com.google.protobuf.Parser<DecisionStrategyProto>
1635 PARSER = new com.google.protobuf.AbstractParser<DecisionStrategyProto>() {
1636 @java.lang.Override
1637 public DecisionStrategyProto parsePartialFrom(
1638 com.google.protobuf.CodedInputStream input,
1639 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1640 throws com.google.protobuf.InvalidProtocolBufferException {
1641 Builder builder = newBuilder();
1642 try {
1643 builder.mergeFrom(input, extensionRegistry);
1644 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1645 throw e.setUnfinishedMessage(builder.buildPartial());
1646 } catch (com.google.protobuf.UninitializedMessageException e) {
1647 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1648 } catch (java.io.IOException e) {
1649 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1650 .setUnfinishedMessage(builder.buildPartial());
1651 }
1652 return builder.buildPartial();
1653 }
1654 };
1655
1656 public static com.google.protobuf.Parser<DecisionStrategyProto> parser() {
1657 return PARSER;
1658 }
1659
1660 @java.lang.Override
1661 public com.google.protobuf.Parser<DecisionStrategyProto> getParserForType() {
1662 return PARSER;
1663 }
1664
1665 @java.lang.Override
1667 return DEFAULT_INSTANCE;
1668 }
1669
1670}
1671
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder addAllVariables(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder addExprs(int index, com.google.ortools.sat.LinearExpressionProto 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()
Builder setExprs(int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
com.google.ortools.sat.LinearExpressionProto.Builder addExprsBuilder()
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)
Builder addExprs(com.google.ortools.sat.LinearExpressionProto 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()
java.util.List< java.lang.Integer > getVariablesList()
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()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
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()
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)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
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()