Google OR-Tools v9.11
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: 4.26.1
5package com.google.ortools.sat;
6
15public final class DecisionStrategyProto extends
16 com.google.protobuf.GeneratedMessage implements
17 // @@protoc_insertion_point(message_implements:operations_research.sat.DecisionStrategyProto)
19private static final long serialVersionUID = 0L;
20 static {
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
23 /* major= */ 4,
24 /* minor= */ 26,
25 /* patch= */ 1,
26 /* suffix= */ "",
27 DecisionStrategyProto.class.getName());
28 }
29 // Use DecisionStrategyProto.newBuilder() to construct.
30 private DecisionStrategyProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
31 super(builder);
32 }
33 private DecisionStrategyProto() {
34 variables_ = emptyIntList();
35 exprs_ = java.util.Collections.emptyList();
36 variableSelectionStrategy_ = 0;
37 domainReductionStrategy_ = 0;
38 }
39
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
43 }
44
45 @java.lang.Override
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.sat.DecisionStrategyProto.class, com.google.ortools.sat.DecisionStrategyProto.Builder.class);
51 }
52
65 implements com.google.protobuf.ProtocolMessageEnum {
87 ;
88
89 static {
90 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
91 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
92 /* major= */ 4,
93 /* minor= */ 26,
94 /* patch= */ 1,
95 /* suffix= */ "",
96 VariableSelectionStrategy.class.getName());
97 }
101 public static final int CHOOSE_FIRST_VALUE = 0;
105 public static final int CHOOSE_LOWEST_MIN_VALUE = 1;
109 public static final int CHOOSE_HIGHEST_MAX_VALUE = 2;
113 public static final int CHOOSE_MIN_DOMAIN_SIZE_VALUE = 3;
117 public static final int CHOOSE_MAX_DOMAIN_SIZE_VALUE = 4;
118
119
120 public final int getNumber() {
121 if (this == UNRECOGNIZED) {
122 throw new java.lang.IllegalArgumentException(
123 "Can't get the number of an unknown enum value.");
124 }
125 return value;
126 }
127
133 @java.lang.Deprecated
134 public static VariableSelectionStrategy valueOf(int value) {
135 return forNumber(value);
136 }
137
142 public static VariableSelectionStrategy forNumber(int value) {
143 switch (value) {
144 case 0: return CHOOSE_FIRST;
145 case 1: return CHOOSE_LOWEST_MIN;
146 case 2: return CHOOSE_HIGHEST_MAX;
147 case 3: return CHOOSE_MIN_DOMAIN_SIZE;
148 case 4: return CHOOSE_MAX_DOMAIN_SIZE;
149 default: return null;
150 }
151 }
152
153 public static com.google.protobuf.Internal.EnumLiteMap<VariableSelectionStrategy>
155 return internalValueMap;
156 }
157 private static final com.google.protobuf.Internal.EnumLiteMap<
158 VariableSelectionStrategy> internalValueMap =
159 new com.google.protobuf.Internal.EnumLiteMap<VariableSelectionStrategy>() {
160 public VariableSelectionStrategy findValueByNumber(int number) {
162 }
163 };
164
165 public final com.google.protobuf.Descriptors.EnumValueDescriptor
167 if (this == UNRECOGNIZED) {
168 throw new java.lang.IllegalStateException(
169 "Can't get the descriptor of an unrecognized enum value.");
170 }
171 return getDescriptor().getValues().get(ordinal());
172 }
173 public final com.google.protobuf.Descriptors.EnumDescriptor
175 return getDescriptor();
176 }
177 public static final com.google.protobuf.Descriptors.EnumDescriptor
179 return com.google.ortools.sat.DecisionStrategyProto.getDescriptor().getEnumTypes().get(0);
180 }
181
182 private static final VariableSelectionStrategy[] VALUES = values();
183
185 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
186 if (desc.getType() != getDescriptor()) {
187 throw new java.lang.IllegalArgumentException(
188 "EnumValueDescriptor is not for this type.");
189 }
190 if (desc.getIndex() == -1) {
191 return UNRECOGNIZED;
192 }
193 return VALUES[desc.getIndex()];
194 }
195
196 private final int value;
197
198 private VariableSelectionStrategy(int value) {
199 this.value = value;
200 }
201
202 // @@protoc_insertion_point(enum_scope:operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy)
203 }
204
216 implements com.google.protobuf.ProtocolMessageEnum {
238 ;
239
240 static {
241 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
242 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
243 /* major= */ 4,
244 /* minor= */ 26,
245 /* patch= */ 1,
246 /* suffix= */ "",
247 DomainReductionStrategy.class.getName());
248 }
252 public static final int SELECT_MIN_VALUE_VALUE = 0;
256 public static final int SELECT_MAX_VALUE_VALUE = 1;
260 public static final int SELECT_LOWER_HALF_VALUE = 2;
264 public static final int SELECT_UPPER_HALF_VALUE = 3;
268 public static final int SELECT_MEDIAN_VALUE_VALUE = 4;
269
270
271 public final int getNumber() {
272 if (this == UNRECOGNIZED) {
273 throw new java.lang.IllegalArgumentException(
274 "Can't get the number of an unknown enum value.");
275 }
276 return value;
277 }
278
284 @java.lang.Deprecated
285 public static DomainReductionStrategy valueOf(int value) {
286 return forNumber(value);
287 }
288
293 public static DomainReductionStrategy forNumber(int value) {
294 switch (value) {
295 case 0: return SELECT_MIN_VALUE;
296 case 1: return SELECT_MAX_VALUE;
297 case 2: return SELECT_LOWER_HALF;
298 case 3: return SELECT_UPPER_HALF;
299 case 4: return SELECT_MEDIAN_VALUE;
300 default: return null;
301 }
302 }
303
304 public static com.google.protobuf.Internal.EnumLiteMap<DomainReductionStrategy>
306 return internalValueMap;
307 }
308 private static final com.google.protobuf.Internal.EnumLiteMap<
309 DomainReductionStrategy> internalValueMap =
310 new com.google.protobuf.Internal.EnumLiteMap<DomainReductionStrategy>() {
311 public DomainReductionStrategy findValueByNumber(int number) {
312 return DomainReductionStrategy.forNumber(number);
313 }
314 };
315
316 public final com.google.protobuf.Descriptors.EnumValueDescriptor
318 if (this == UNRECOGNIZED) {
319 throw new java.lang.IllegalStateException(
320 "Can't get the descriptor of an unrecognized enum value.");
321 }
322 return getDescriptor().getValues().get(ordinal());
323 }
324 public final com.google.protobuf.Descriptors.EnumDescriptor
326 return getDescriptor();
327 }
328 public static final com.google.protobuf.Descriptors.EnumDescriptor
330 return com.google.ortools.sat.DecisionStrategyProto.getDescriptor().getEnumTypes().get(1);
331 }
332
333 private static final DomainReductionStrategy[] VALUES = values();
334
336 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
337 if (desc.getType() != getDescriptor()) {
338 throw new java.lang.IllegalArgumentException(
339 "EnumValueDescriptor is not for this type.");
340 }
341 if (desc.getIndex() == -1) {
342 return UNRECOGNIZED;
343 }
344 return VALUES[desc.getIndex()];
345 }
346
347 private final int value;
348
349 private DomainReductionStrategy(int value) {
350 this.value = value;
351 }
352
353 // @@protoc_insertion_point(enum_scope:operations_research.sat.DecisionStrategyProto.DomainReductionStrategy)
354 }
355
356 public static final int VARIABLES_FIELD_NUMBER = 1;
357 @SuppressWarnings("serial")
358 private com.google.protobuf.Internal.IntList variables_ =
359 emptyIntList();
370 @java.lang.Override
371 public java.util.List<java.lang.Integer>
373 return variables_;
374 }
385 public int getVariablesCount() {
386 return variables_.size();
387 }
399 public int getVariables(int index) {
400 return variables_.getInt(index);
401 }
402 private int variablesMemoizedSerializedSize = -1;
403
404 public static final int EXPRS_FIELD_NUMBER = 5;
405 @SuppressWarnings("serial")
406 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_;
419 @java.lang.Override
420 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getExprsList() {
421 return exprs_;
422 }
435 @java.lang.Override
436 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
438 return exprs_;
439 }
452 @java.lang.Override
453 public int getExprsCount() {
454 return exprs_.size();
455 }
468 @java.lang.Override
470 return exprs_.get(index);
471 }
484 @java.lang.Override
486 int index) {
487 return exprs_.get(index);
488 }
489
490 public static final int VARIABLE_SELECTION_STRATEGY_FIELD_NUMBER = 2;
491 private int variableSelectionStrategy_ = 0;
496 @java.lang.Override public int getVariableSelectionStrategyValue() {
497 return variableSelectionStrategy_;
498 }
504 com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy result = com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.forNumber(variableSelectionStrategy_);
505 return result == null ? com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.UNRECOGNIZED : result;
506 }
507
508 public static final int DOMAIN_REDUCTION_STRATEGY_FIELD_NUMBER = 3;
509 private int domainReductionStrategy_ = 0;
514 @java.lang.Override public int getDomainReductionStrategyValue() {
515 return domainReductionStrategy_;
516 }
522 com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy result = com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.forNumber(domainReductionStrategy_);
523 return result == null ? com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.UNRECOGNIZED : result;
524 }
525
526 private byte memoizedIsInitialized = -1;
527 @java.lang.Override
528 public final boolean isInitialized() {
529 byte isInitialized = memoizedIsInitialized;
530 if (isInitialized == 1) return true;
531 if (isInitialized == 0) return false;
532
533 memoizedIsInitialized = 1;
534 return true;
535 }
536
537 @java.lang.Override
538 public void writeTo(com.google.protobuf.CodedOutputStream output)
539 throws java.io.IOException {
541 if (getVariablesList().size() > 0) {
542 output.writeUInt32NoTag(10);
543 output.writeUInt32NoTag(variablesMemoizedSerializedSize);
544 }
545 for (int i = 0; i < variables_.size(); i++) {
546 output.writeInt32NoTag(variables_.getInt(i));
547 }
548 if (variableSelectionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.CHOOSE_FIRST.getNumber()) {
549 output.writeEnum(2, variableSelectionStrategy_);
550 }
551 if (domainReductionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.SELECT_MIN_VALUE.getNumber()) {
552 output.writeEnum(3, domainReductionStrategy_);
553 }
554 for (int i = 0; i < exprs_.size(); i++) {
555 output.writeMessage(5, exprs_.get(i));
556 }
557 getUnknownFields().writeTo(output);
558 }
559
560 @java.lang.Override
561 public int getSerializedSize() {
562 int size = memoizedSize;
563 if (size != -1) return size;
564
565 size = 0;
566 {
567 int dataSize = 0;
568 for (int i = 0; i < variables_.size(); i++) {
569 dataSize += com.google.protobuf.CodedOutputStream
570 .computeInt32SizeNoTag(variables_.getInt(i));
571 }
572 size += dataSize;
573 if (!getVariablesList().isEmpty()) {
574 size += 1;
575 size += com.google.protobuf.CodedOutputStream
576 .computeInt32SizeNoTag(dataSize);
577 }
578 variablesMemoizedSerializedSize = dataSize;
579 }
580 if (variableSelectionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.CHOOSE_FIRST.getNumber()) {
581 size += com.google.protobuf.CodedOutputStream
582 .computeEnumSize(2, variableSelectionStrategy_);
583 }
584 if (domainReductionStrategy_ != com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.SELECT_MIN_VALUE.getNumber()) {
585 size += com.google.protobuf.CodedOutputStream
586 .computeEnumSize(3, domainReductionStrategy_);
587 }
588 for (int i = 0; i < exprs_.size(); i++) {
589 size += com.google.protobuf.CodedOutputStream
590 .computeMessageSize(5, exprs_.get(i));
591 }
592 size += getUnknownFields().getSerializedSize();
593 memoizedSize = size;
594 return size;
595 }
596
597 @java.lang.Override
598 public boolean equals(final java.lang.Object obj) {
599 if (obj == this) {
600 return true;
601 }
602 if (!(obj instanceof com.google.ortools.sat.DecisionStrategyProto)) {
603 return super.equals(obj);
604 }
605 com.google.ortools.sat.DecisionStrategyProto other = (com.google.ortools.sat.DecisionStrategyProto) obj;
606
607 if (!getVariablesList()
608 .equals(other.getVariablesList())) return false;
609 if (!getExprsList()
610 .equals(other.getExprsList())) return false;
611 if (variableSelectionStrategy_ != other.variableSelectionStrategy_) return false;
612 if (domainReductionStrategy_ != other.domainReductionStrategy_) return false;
613 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
614 return true;
615 }
616
617 @java.lang.Override
618 public int hashCode() {
619 if (memoizedHashCode != 0) {
620 return memoizedHashCode;
621 }
622 int hash = 41;
623 hash = (19 * hash) + getDescriptor().hashCode();
624 if (getVariablesCount() > 0) {
625 hash = (37 * hash) + VARIABLES_FIELD_NUMBER;
626 hash = (53 * hash) + getVariablesList().hashCode();
627 }
628 if (getExprsCount() > 0) {
629 hash = (37 * hash) + EXPRS_FIELD_NUMBER;
630 hash = (53 * hash) + getExprsList().hashCode();
631 }
632 hash = (37 * hash) + VARIABLE_SELECTION_STRATEGY_FIELD_NUMBER;
633 hash = (53 * hash) + variableSelectionStrategy_;
634 hash = (37 * hash) + DOMAIN_REDUCTION_STRATEGY_FIELD_NUMBER;
635 hash = (53 * hash) + domainReductionStrategy_;
636 hash = (29 * hash) + getUnknownFields().hashCode();
637 memoizedHashCode = hash;
638 return hash;
639 }
640
642 java.nio.ByteBuffer data)
643 throws com.google.protobuf.InvalidProtocolBufferException {
644 return PARSER.parseFrom(data);
645 }
647 java.nio.ByteBuffer data,
648 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
649 throws com.google.protobuf.InvalidProtocolBufferException {
650 return PARSER.parseFrom(data, extensionRegistry);
651 }
653 com.google.protobuf.ByteString data)
654 throws com.google.protobuf.InvalidProtocolBufferException {
655 return PARSER.parseFrom(data);
656 }
658 com.google.protobuf.ByteString data,
659 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
660 throws com.google.protobuf.InvalidProtocolBufferException {
661 return PARSER.parseFrom(data, extensionRegistry);
662 }
664 throws com.google.protobuf.InvalidProtocolBufferException {
665 return PARSER.parseFrom(data);
666 }
668 byte[] data,
669 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
670 throws com.google.protobuf.InvalidProtocolBufferException {
671 return PARSER.parseFrom(data, extensionRegistry);
672 }
673 public static com.google.ortools.sat.DecisionStrategyProto parseFrom(java.io.InputStream input)
674 throws java.io.IOException {
675 return com.google.protobuf.GeneratedMessage
676 .parseWithIOException(PARSER, input);
677 }
679 java.io.InputStream input,
680 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
681 throws java.io.IOException {
682 return com.google.protobuf.GeneratedMessage
683 .parseWithIOException(PARSER, input, extensionRegistry);
684 }
685
687 throws java.io.IOException {
688 return com.google.protobuf.GeneratedMessage
689 .parseDelimitedWithIOException(PARSER, input);
690 }
691
693 java.io.InputStream input,
694 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
695 throws java.io.IOException {
696 return com.google.protobuf.GeneratedMessage
697 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
698 }
700 com.google.protobuf.CodedInputStream input)
701 throws java.io.IOException {
702 return com.google.protobuf.GeneratedMessage
703 .parseWithIOException(PARSER, input);
704 }
706 com.google.protobuf.CodedInputStream input,
707 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
708 throws java.io.IOException {
709 return com.google.protobuf.GeneratedMessage
710 .parseWithIOException(PARSER, input, extensionRegistry);
711 }
712
713 @java.lang.Override
714 public Builder newBuilderForType() { return newBuilder(); }
715 public static Builder newBuilder() {
716 return DEFAULT_INSTANCE.toBuilder();
717 }
718 public static Builder newBuilder(com.google.ortools.sat.DecisionStrategyProto prototype) {
719 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
720 }
721 @java.lang.Override
723 return this == DEFAULT_INSTANCE
724 ? new Builder() : new Builder().mergeFrom(this);
725 }
726
727 @java.lang.Override
729 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
730 Builder builder = new Builder(parent);
731 return builder;
732 }
741 public static final class Builder extends
742 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
743 // @@protoc_insertion_point(builder_implements:operations_research.sat.DecisionStrategyProto)
744 com.google.ortools.sat.DecisionStrategyProtoOrBuilder {
745 public static final com.google.protobuf.Descriptors.Descriptor
747 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
748 }
749
750 @java.lang.Override
751 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
753 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_fieldAccessorTable
754 .ensureFieldAccessorsInitialized(
755 com.google.ortools.sat.DecisionStrategyProto.class, com.google.ortools.sat.DecisionStrategyProto.Builder.class);
756 }
757
758 // Construct using com.google.ortools.sat.DecisionStrategyProto.newBuilder()
759 private Builder() {
760
761 }
762
763 private Builder(
764 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
765 super(parent);
766
767 }
768 @java.lang.Override
769 public Builder clear() {
770 super.clear();
771 bitField0_ = 0;
772 variables_ = emptyIntList();
773 if (exprsBuilder_ == null) {
774 exprs_ = java.util.Collections.emptyList();
775 } else {
776 exprs_ = null;
777 exprsBuilder_.clear();
778 }
779 bitField0_ = (bitField0_ & ~0x00000002);
780 variableSelectionStrategy_ = 0;
781 domainReductionStrategy_ = 0;
782 return this;
783 }
784
785 @java.lang.Override
786 public com.google.protobuf.Descriptors.Descriptor
788 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_DecisionStrategyProto_descriptor;
789 }
790
791 @java.lang.Override
793 return com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance();
794 }
795
796 @java.lang.Override
799 if (!result.isInitialized()) {
800 throw newUninitializedMessageException(result);
801 }
802 return result;
803 }
804
805 @java.lang.Override
807 com.google.ortools.sat.DecisionStrategyProto result = new com.google.ortools.sat.DecisionStrategyProto(this);
808 buildPartialRepeatedFields(result);
809 if (bitField0_ != 0) { buildPartial0(result); }
810 onBuilt();
811 return result;
812 }
813
814 private void buildPartialRepeatedFields(com.google.ortools.sat.DecisionStrategyProto result) {
815 if (exprsBuilder_ == null) {
816 if (((bitField0_ & 0x00000002) != 0)) {
817 exprs_ = java.util.Collections.unmodifiableList(exprs_);
818 bitField0_ = (bitField0_ & ~0x00000002);
819 }
820 result.exprs_ = exprs_;
821 } else {
822 result.exprs_ = exprsBuilder_.build();
823 }
824 }
825
826 private void buildPartial0(com.google.ortools.sat.DecisionStrategyProto result) {
827 int from_bitField0_ = bitField0_;
828 if (((from_bitField0_ & 0x00000001) != 0)) {
829 variables_.makeImmutable();
830 result.variables_ = variables_;
831 }
832 if (((from_bitField0_ & 0x00000004) != 0)) {
833 result.variableSelectionStrategy_ = variableSelectionStrategy_;
834 }
835 if (((from_bitField0_ & 0x00000008) != 0)) {
836 result.domainReductionStrategy_ = domainReductionStrategy_;
837 }
838 }
839
840 @java.lang.Override
841 public Builder mergeFrom(com.google.protobuf.Message other) {
842 if (other instanceof com.google.ortools.sat.DecisionStrategyProto) {
843 return mergeFrom((com.google.ortools.sat.DecisionStrategyProto)other);
844 } else {
845 super.mergeFrom(other);
846 return this;
847 }
848 }
849
850 public Builder mergeFrom(com.google.ortools.sat.DecisionStrategyProto other) {
851 if (other == com.google.ortools.sat.DecisionStrategyProto.getDefaultInstance()) return this;
852 if (!other.variables_.isEmpty()) {
853 if (variables_.isEmpty()) {
854 variables_ = other.variables_;
855 variables_.makeImmutable();
856 bitField0_ |= 0x00000001;
857 } else {
858 ensureVariablesIsMutable();
859 variables_.addAll(other.variables_);
860 }
861 onChanged();
862 }
863 if (exprsBuilder_ == null) {
864 if (!other.exprs_.isEmpty()) {
865 if (exprs_.isEmpty()) {
866 exprs_ = other.exprs_;
867 bitField0_ = (bitField0_ & ~0x00000002);
868 } else {
869 ensureExprsIsMutable();
870 exprs_.addAll(other.exprs_);
871 }
872 onChanged();
873 }
874 } else {
875 if (!other.exprs_.isEmpty()) {
876 if (exprsBuilder_.isEmpty()) {
877 exprsBuilder_.dispose();
878 exprsBuilder_ = null;
879 exprs_ = other.exprs_;
880 bitField0_ = (bitField0_ & ~0x00000002);
881 exprsBuilder_ =
882 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
883 getExprsFieldBuilder() : null;
884 } else {
885 exprsBuilder_.addAllMessages(other.exprs_);
886 }
887 }
888 }
889 if (other.variableSelectionStrategy_ != 0) {
890 setVariableSelectionStrategyValue(other.getVariableSelectionStrategyValue());
891 }
892 if (other.domainReductionStrategy_ != 0) {
893 setDomainReductionStrategyValue(other.getDomainReductionStrategyValue());
894 }
895 this.mergeUnknownFields(other.getUnknownFields());
896 onChanged();
897 return this;
898 }
899
900 @java.lang.Override
901 public final boolean isInitialized() {
902 return true;
903 }
904
905 @java.lang.Override
907 com.google.protobuf.CodedInputStream input,
908 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
909 throws java.io.IOException {
910 if (extensionRegistry == null) {
911 throw new java.lang.NullPointerException();
912 }
913 try {
914 boolean done = false;
915 while (!done) {
916 int tag = input.readTag();
917 switch (tag) {
918 case 0:
919 done = true;
920 break;
921 case 8: {
922 int v = input.readInt32();
923 ensureVariablesIsMutable();
924 variables_.addInt(v);
925 break;
926 } // case 8
927 case 10: {
928 int length = input.readRawVarint32();
929 int limit = input.pushLimit(length);
930 ensureVariablesIsMutable();
931 while (input.getBytesUntilLimit() > 0) {
932 variables_.addInt(input.readInt32());
933 }
934 input.popLimit(limit);
935 break;
936 } // case 10
937 case 16: {
938 variableSelectionStrategy_ = input.readEnum();
939 bitField0_ |= 0x00000004;
940 break;
941 } // case 16
942 case 24: {
943 domainReductionStrategy_ = input.readEnum();
944 bitField0_ |= 0x00000008;
945 break;
946 } // case 24
947 case 42: {
949 input.readMessage(
950 com.google.ortools.sat.LinearExpressionProto.parser(),
951 extensionRegistry);
952 if (exprsBuilder_ == null) {
953 ensureExprsIsMutable();
954 exprs_.add(m);
955 } else {
956 exprsBuilder_.addMessage(m);
957 }
958 break;
959 } // case 42
960 default: {
961 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
962 done = true; // was an endgroup tag
963 }
964 break;
965 } // default:
966 } // switch (tag)
967 } // while (!done)
968 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
969 throw e.unwrapIOException();
970 } finally {
971 onChanged();
972 } // finally
973 return this;
974 }
975 private int bitField0_;
976
977 private com.google.protobuf.Internal.IntList variables_ = emptyIntList();
978 private void ensureVariablesIsMutable() {
979 if (!variables_.isModifiable()) {
980 variables_ = makeMutableCopy(variables_);
981 }
982 bitField0_ |= 0x00000001;
983 }
994 public java.util.List<java.lang.Integer>
996 variables_.makeImmutable();
997 return variables_;
998 }
1009 public int getVariablesCount() {
1010 return variables_.size();
1011 }
1023 public int getVariables(int index) {
1024 return variables_.getInt(index);
1025 }
1039 int index, int value) {
1040
1041 ensureVariablesIsMutable();
1042 variables_.setInt(index, value);
1043 bitField0_ |= 0x00000001;
1044 onChanged();
1045 return this;
1046 }
1058 public Builder addVariables(int value) {
1059
1060 ensureVariablesIsMutable();
1061 variables_.addInt(value);
1062 bitField0_ |= 0x00000001;
1063 onChanged();
1064 return this;
1065 }
1078 java.lang.Iterable<? extends java.lang.Integer> values) {
1079 ensureVariablesIsMutable();
1080 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1081 values, variables_);
1082 bitField0_ |= 0x00000001;
1083 onChanged();
1084 return this;
1085 }
1097 variables_ = emptyIntList();
1098 bitField0_ = (bitField0_ & ~0x00000001);
1099 onChanged();
1100 return this;
1101 }
1102
1103 private java.util.List<com.google.ortools.sat.LinearExpressionProto> exprs_ =
1104 java.util.Collections.emptyList();
1105 private void ensureExprsIsMutable() {
1106 if (!((bitField0_ & 0x00000002) != 0)) {
1107 exprs_ = new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(exprs_);
1108 bitField0_ |= 0x00000002;
1109 }
1110 }
1111
1112 private com.google.protobuf.RepeatedFieldBuilder<
1113 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> exprsBuilder_;
1114
1127 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getExprsList() {
1128 if (exprsBuilder_ == null) {
1129 return java.util.Collections.unmodifiableList(exprs_);
1130 } else {
1131 return exprsBuilder_.getMessageList();
1132 }
1133 }
1146 public int getExprsCount() {
1147 if (exprsBuilder_ == null) {
1148 return exprs_.size();
1149 } else {
1150 return exprsBuilder_.getCount();
1151 }
1152 }
1166 if (exprsBuilder_ == null) {
1167 return exprs_.get(index);
1168 } else {
1169 return exprsBuilder_.getMessage(index);
1170 }
1171 }
1185 int index, com.google.ortools.sat.LinearExpressionProto value) {
1186 if (exprsBuilder_ == null) {
1187 if (value == null) {
1188 throw new NullPointerException();
1189 }
1190 ensureExprsIsMutable();
1191 exprs_.set(index, value);
1192 onChanged();
1193 } else {
1194 exprsBuilder_.setMessage(index, value);
1195 }
1196 return this;
1197 }
1211 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1212 if (exprsBuilder_ == null) {
1213 ensureExprsIsMutable();
1214 exprs_.set(index, builderForValue.build());
1215 onChanged();
1216 } else {
1217 exprsBuilder_.setMessage(index, builderForValue.build());
1218 }
1219 return this;
1220 }
1233 public Builder addExprs(com.google.ortools.sat.LinearExpressionProto value) {
1234 if (exprsBuilder_ == null) {
1235 if (value == null) {
1236 throw new NullPointerException();
1237 }
1238 ensureExprsIsMutable();
1239 exprs_.add(value);
1240 onChanged();
1241 } else {
1242 exprsBuilder_.addMessage(value);
1243 }
1244 return this;
1245 }
1259 int index, com.google.ortools.sat.LinearExpressionProto value) {
1260 if (exprsBuilder_ == null) {
1261 if (value == null) {
1262 throw new NullPointerException();
1263 }
1264 ensureExprsIsMutable();
1265 exprs_.add(index, value);
1266 onChanged();
1267 } else {
1268 exprsBuilder_.addMessage(index, value);
1269 }
1270 return this;
1271 }
1285 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1286 if (exprsBuilder_ == null) {
1287 ensureExprsIsMutable();
1288 exprs_.add(builderForValue.build());
1289 onChanged();
1290 } else {
1291 exprsBuilder_.addMessage(builderForValue.build());
1292 }
1293 return this;
1294 }
1308 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1309 if (exprsBuilder_ == null) {
1310 ensureExprsIsMutable();
1311 exprs_.add(index, builderForValue.build());
1312 onChanged();
1313 } else {
1314 exprsBuilder_.addMessage(index, builderForValue.build());
1315 }
1316 return this;
1317 }
1331 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
1332 if (exprsBuilder_ == null) {
1333 ensureExprsIsMutable();
1334 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1335 values, exprs_);
1336 onChanged();
1337 } else {
1338 exprsBuilder_.addAllMessages(values);
1339 }
1340 return this;
1341 }
1355 if (exprsBuilder_ == null) {
1356 exprs_ = java.util.Collections.emptyList();
1357 bitField0_ = (bitField0_ & ~0x00000002);
1358 onChanged();
1359 } else {
1360 exprsBuilder_.clear();
1361 }
1362 return this;
1363 }
1376 public Builder removeExprs(int index) {
1377 if (exprsBuilder_ == null) {
1378 ensureExprsIsMutable();
1379 exprs_.remove(index);
1380 onChanged();
1381 } else {
1382 exprsBuilder_.remove(index);
1383 }
1384 return this;
1385 }
1399 int index) {
1400 return getExprsFieldBuilder().getBuilder(index);
1401 }
1415 int index) {
1416 if (exprsBuilder_ == null) {
1417 return exprs_.get(index); } else {
1418 return exprsBuilder_.getMessageOrBuilder(index);
1419 }
1420 }
1433 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1435 if (exprsBuilder_ != null) {
1436 return exprsBuilder_.getMessageOrBuilderList();
1437 } else {
1438 return java.util.Collections.unmodifiableList(exprs_);
1439 }
1440 }
1454 return getExprsFieldBuilder().addBuilder(
1455 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1456 }
1470 int index) {
1471 return getExprsFieldBuilder().addBuilder(
1472 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1473 }
1486 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
1488 return getExprsFieldBuilder().getBuilderList();
1489 }
1490 private com.google.protobuf.RepeatedFieldBuilder<
1491 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1492 getExprsFieldBuilder() {
1493 if (exprsBuilder_ == null) {
1494 exprsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
1495 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
1496 exprs_,
1497 ((bitField0_ & 0x00000002) != 0),
1498 getParentForChildren(),
1499 isClean());
1500 exprs_ = null;
1501 }
1502 return exprsBuilder_;
1503 }
1504
1505 private int variableSelectionStrategy_ = 0;
1510 @java.lang.Override public int getVariableSelectionStrategyValue() {
1511 return variableSelectionStrategy_;
1512 }
1519 variableSelectionStrategy_ = value;
1520 bitField0_ |= 0x00000004;
1521 onChanged();
1522 return this;
1523 }
1528 @java.lang.Override
1530 com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy result = com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.forNumber(variableSelectionStrategy_);
1531 return result == null ? com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy.UNRECOGNIZED : result;
1532 }
1538 public Builder setVariableSelectionStrategy(com.google.ortools.sat.DecisionStrategyProto.VariableSelectionStrategy value) {
1539 if (value == null) {
1540 throw new NullPointerException();
1541 }
1542 bitField0_ |= 0x00000004;
1543 variableSelectionStrategy_ = value.getNumber();
1544 onChanged();
1545 return this;
1546 }
1552 bitField0_ = (bitField0_ & ~0x00000004);
1553 variableSelectionStrategy_ = 0;
1554 onChanged();
1555 return this;
1556 }
1557
1558 private int domainReductionStrategy_ = 0;
1563 @java.lang.Override public int getDomainReductionStrategyValue() {
1564 return domainReductionStrategy_;
1565 }
1572 domainReductionStrategy_ = value;
1573 bitField0_ |= 0x00000008;
1574 onChanged();
1575 return this;
1576 }
1581 @java.lang.Override
1583 com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy result = com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.forNumber(domainReductionStrategy_);
1584 return result == null ? com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy.UNRECOGNIZED : result;
1585 }
1591 public Builder setDomainReductionStrategy(com.google.ortools.sat.DecisionStrategyProto.DomainReductionStrategy value) {
1592 if (value == null) {
1593 throw new NullPointerException();
1594 }
1595 bitField0_ |= 0x00000008;
1596 domainReductionStrategy_ = value.getNumber();
1597 onChanged();
1598 return this;
1599 }
1605 bitField0_ = (bitField0_ & ~0x00000008);
1606 domainReductionStrategy_ = 0;
1607 onChanged();
1608 return this;
1609 }
1610
1611 // @@protoc_insertion_point(builder_scope:operations_research.sat.DecisionStrategyProto)
1612 }
1613
1614 // @@protoc_insertion_point(class_scope:operations_research.sat.DecisionStrategyProto)
1615 private static final com.google.ortools.sat.DecisionStrategyProto DEFAULT_INSTANCE;
1616 static {
1617 DEFAULT_INSTANCE = new com.google.ortools.sat.DecisionStrategyProto();
1618 }
1619
1621 return DEFAULT_INSTANCE;
1622 }
1623
1624 private static final com.google.protobuf.Parser<DecisionStrategyProto>
1625 PARSER = new com.google.protobuf.AbstractParser<DecisionStrategyProto>() {
1626 @java.lang.Override
1627 public DecisionStrategyProto parsePartialFrom(
1628 com.google.protobuf.CodedInputStream input,
1629 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1630 throws com.google.protobuf.InvalidProtocolBufferException {
1631 Builder builder = newBuilder();
1632 try {
1633 builder.mergeFrom(input, extensionRegistry);
1634 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1635 throw e.setUnfinishedMessage(builder.buildPartial());
1636 } catch (com.google.protobuf.UninitializedMessageException e) {
1637 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1638 } catch (java.io.IOException e) {
1639 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1640 .setUnfinishedMessage(builder.buildPartial());
1641 }
1642 return builder.buildPartial();
1643 }
1644 };
1645
1646 public static com.google.protobuf.Parser<DecisionStrategyProto> parser() {
1647 return PARSER;
1648 }
1649
1650 @java.lang.Override
1651 public com.google.protobuf.Parser<DecisionStrategyProto> getParserForType() {
1652 return PARSER;
1653 }
1654
1655 @java.lang.Override
1657 return DEFAULT_INSTANCE;
1658 }
1659
1660}
1661
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()