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