ortools.service.v1.mathopt.model_pb2
@generated by mypy-protobuf. Do not edit manually! isort:skip_file An encoding format for mathematical optimization problems.
1# -*- coding: utf-8 -*- 2# Generated by the protocol buffer compiler. DO NOT EDIT! 3# NO CHECKED-IN PROTOBUF GENCODE 4# source: ortools/service/v1/mathopt/model.proto 5# Protobuf Python Version: 6.31.1 6"""Generated protocol buffer code.""" 7from google.protobuf import descriptor as _descriptor 8from google.protobuf import descriptor_pool as _descriptor_pool 9from google.protobuf import runtime_version as _runtime_version 10from google.protobuf import symbol_database as _symbol_database 11from google.protobuf.internal import builder as _builder 12_runtime_version.ValidateProtobufRuntimeVersion( 13 _runtime_version.Domain.PUBLIC, 14 6, 15 31, 16 1, 17 '', 18 'ortools/service/v1/mathopt/model.proto' 19) 20# @@protoc_insertion_point(imports) 21 22_sym_db = _symbol_database.Default() 23 24 25from ortools.service.v1.mathopt import sparse_containers_pb2 as ortools_dot_service_dot_v1_dot_mathopt_dot_sparse__containers__pb2 26 27 28DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&ortools/service/v1/mathopt/model.proto\x12&operations_research.service.v1.mathopt\x1a\x32ortools/service/v1/mathopt/sparse_containers.proto\"j\n\x0eVariablesProto\x12\x0b\n\x03ids\x18\x01 \x03(\x03\x12\x14\n\x0clower_bounds\x18\x02 \x03(\x01\x12\x14\n\x0cupper_bounds\x18\x03 \x03(\x01\x12\x10\n\x08integers\x18\x04 \x03(\x08\x12\r\n\x05names\x18\x05 \x03(\t\"\x91\x02\n\x0eObjectiveProto\x12\x10\n\x08maximize\x18\x01 \x01(\x08\x12\x0e\n\x06offset\x18\x02 \x01(\x01\x12\\\n\x13linear_coefficients\x18\x03 \x01(\x0b\x32?.operations_research.service.v1.mathopt.SparseDoubleVectorProto\x12_\n\x16quadratic_coefficients\x18\x04 \x01(\x0b\x32?.operations_research.service.v1.mathopt.SparseDoubleMatrixProto\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x10\n\x08priority\x18\x06 \x01(\x03\"`\n\x16LinearConstraintsProto\x12\x0b\n\x03ids\x18\x01 \x03(\x03\x12\x14\n\x0clower_bounds\x18\x02 \x03(\x01\x12\x14\n\x0cupper_bounds\x18\x03 \x03(\x01\x12\r\n\x05names\x18\x04 \x03(\t\"\x83\x02\n\x18QuadraticConstraintProto\x12U\n\x0clinear_terms\x18\x01 \x01(\x0b\x32?.operations_research.service.v1.mathopt.SparseDoubleVectorProto\x12X\n\x0fquadratic_terms\x18\x02 \x01(\x0b\x32?.operations_research.service.v1.mathopt.SparseDoubleMatrixProto\x12\x13\n\x0blower_bound\x18\x03 \x01(\x01\x12\x13\n\x0bupper_bound\x18\x04 \x01(\x01\x12\x0c\n\x04name\x18\x05 \x01(\t\"\xdc\x01\n\x1eSecondOrderConeConstraintProto\x12R\n\x0bupper_bound\x18\x01 \x01(\x0b\x32=.operations_research.service.v1.mathopt.LinearExpressionProto\x12X\n\x11\x61rguments_to_norm\x18\x02 \x03(\x0b\x32=.operations_research.service.v1.mathopt.LinearExpressionProto\x12\x0c\n\x04name\x18\x03 \x01(\t\"\x87\x01\n\x12SosConstraintProto\x12R\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32=.operations_research.service.v1.mathopt.LinearExpressionProto\x12\x0f\n\x07weights\x18\x02 \x03(\x01\x12\x0c\n\x04name\x18\x03 \x01(\t\"\xed\x01\n\x18IndicatorConstraintProto\x12\x19\n\x0cindicator_id\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x18\n\x10\x61\x63tivate_on_zero\x18\x06 \x01(\x08\x12S\n\nexpression\x18\x02 \x01(\x0b\x32?.operations_research.service.v1.mathopt.SparseDoubleVectorProto\x12\x13\n\x0blower_bound\x18\x03 \x01(\x01\x12\x13\n\x0bupper_bound\x18\x04 \x01(\x01\x12\x0c\n\x04name\x18\x05 \x01(\tB\x0f\n\r_indicator_id\"\xdb\r\n\nModelProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12I\n\tvariables\x18\x02 \x01(\x0b\x32\x36.operations_research.service.v1.mathopt.VariablesProto\x12I\n\tobjective\x18\x03 \x01(\x0b\x32\x36.operations_research.service.v1.mathopt.ObjectiveProto\x12i\n\x14\x61uxiliary_objectives\x18\n \x03(\x0b\x32K.operations_research.service.v1.mathopt.ModelProto.AuxiliaryObjectivesEntry\x12Z\n\x12linear_constraints\x18\x04 \x01(\x0b\x32>.operations_research.service.v1.mathopt.LinearConstraintsProto\x12\x61\n\x18linear_constraint_matrix\x18\x05 \x01(\x0b\x32?.operations_research.service.v1.mathopt.SparseDoubleMatrixProto\x12k\n\x15quadratic_constraints\x18\x06 \x03(\x0b\x32L.operations_research.service.v1.mathopt.ModelProto.QuadraticConstraintsEntry\x12y\n\x1dsecond_order_cone_constraints\x18\x0b \x03(\x0b\x32R.operations_research.service.v1.mathopt.ModelProto.SecondOrderConeConstraintsEntry\x12\x61\n\x10sos1_constraints\x18\x07 \x03(\x0b\x32G.operations_research.service.v1.mathopt.ModelProto.Sos1ConstraintsEntry\x12\x61\n\x10sos2_constraints\x18\x08 \x03(\x0b\x32G.operations_research.service.v1.mathopt.ModelProto.Sos2ConstraintsEntry\x12k\n\x15indicator_constraints\x18\t \x03(\x0b\x32L.operations_research.service.v1.mathopt.ModelProto.IndicatorConstraintsEntry\x1ar\n\x18\x41uxiliaryObjectivesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.operations_research.service.v1.mathopt.ObjectiveProto:\x02\x38\x01\x1a}\n\x19QuadraticConstraintsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12O\n\x05value\x18\x02 \x01(\x0b\x32@.operations_research.service.v1.mathopt.QuadraticConstraintProto:\x02\x38\x01\x1a\x89\x01\n\x1fSecondOrderConeConstraintsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12U\n\x05value\x18\x02 \x01(\x0b\x32\x46.operations_research.service.v1.mathopt.SecondOrderConeConstraintProto:\x02\x38\x01\x1ar\n\x14Sos1ConstraintsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12I\n\x05value\x18\x02 \x01(\x0b\x32:.operations_research.service.v1.mathopt.SosConstraintProto:\x02\x38\x01\x1ar\n\x14Sos2ConstraintsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12I\n\x05value\x18\x02 \x01(\x0b\x32:.operations_research.service.v1.mathopt.SosConstraintProto:\x02\x38\x01\x1a}\n\x19IndicatorConstraintsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12O\n\x05value\x18\x02 \x01(\x0b\x32@.operations_research.service.v1.mathopt.IndicatorConstraintProto:\x02\x38\x01\x42\x42\n%com.google.ortools.service.v1.mathoptP\x01\xaa\x02\x16Google.OrTools.Serviceb\x06proto3') 29 30_globals = globals() 31_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) 32_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ortools.service.v1.mathopt.model_pb2', _globals) 33if not _descriptor._USE_C_DESCRIPTORS: 34 _globals['DESCRIPTOR']._loaded_options = None 35 _globals['DESCRIPTOR']._serialized_options = b'\n%com.google.ortools.service.v1.mathoptP\001\252\002\026Google.OrTools.Service' 36 _globals['_MODELPROTO_AUXILIARYOBJECTIVESENTRY']._loaded_options = None 37 _globals['_MODELPROTO_AUXILIARYOBJECTIVESENTRY']._serialized_options = b'8\001' 38 _globals['_MODELPROTO_QUADRATICCONSTRAINTSENTRY']._loaded_options = None 39 _globals['_MODELPROTO_QUADRATICCONSTRAINTSENTRY']._serialized_options = b'8\001' 40 _globals['_MODELPROTO_SECONDORDERCONECONSTRAINTSENTRY']._loaded_options = None 41 _globals['_MODELPROTO_SECONDORDERCONECONSTRAINTSENTRY']._serialized_options = b'8\001' 42 _globals['_MODELPROTO_SOS1CONSTRAINTSENTRY']._loaded_options = None 43 _globals['_MODELPROTO_SOS1CONSTRAINTSENTRY']._serialized_options = b'8\001' 44 _globals['_MODELPROTO_SOS2CONSTRAINTSENTRY']._loaded_options = None 45 _globals['_MODELPROTO_SOS2CONSTRAINTSENTRY']._serialized_options = b'8\001' 46 _globals['_MODELPROTO_INDICATORCONSTRAINTSENTRY']._loaded_options = None 47 _globals['_MODELPROTO_INDICATORCONSTRAINTSENTRY']._serialized_options = b'8\001' 48 _globals['_VARIABLESPROTO']._serialized_start=134 49 _globals['_VARIABLESPROTO']._serialized_end=240 50 _globals['_OBJECTIVEPROTO']._serialized_start=243 51 _globals['_OBJECTIVEPROTO']._serialized_end=516 52 _globals['_LINEARCONSTRAINTSPROTO']._serialized_start=518 53 _globals['_LINEARCONSTRAINTSPROTO']._serialized_end=614 54 _globals['_QUADRATICCONSTRAINTPROTO']._serialized_start=617 55 _globals['_QUADRATICCONSTRAINTPROTO']._serialized_end=876 56 _globals['_SECONDORDERCONECONSTRAINTPROTO']._serialized_start=879 57 _globals['_SECONDORDERCONECONSTRAINTPROTO']._serialized_end=1099 58 _globals['_SOSCONSTRAINTPROTO']._serialized_start=1102 59 _globals['_SOSCONSTRAINTPROTO']._serialized_end=1237 60 _globals['_INDICATORCONSTRAINTPROTO']._serialized_start=1240 61 _globals['_INDICATORCONSTRAINTPROTO']._serialized_end=1477 62 _globals['_MODELPROTO']._serialized_start=1480 63 _globals['_MODELPROTO']._serialized_end=3235 64 _globals['_MODELPROTO_AUXILIARYOBJECTIVESENTRY']._serialized_start=2495 65 _globals['_MODELPROTO_AUXILIARYOBJECTIVESENTRY']._serialized_end=2609 66 _globals['_MODELPROTO_QUADRATICCONSTRAINTSENTRY']._serialized_start=2611 67 _globals['_MODELPROTO_QUADRATICCONSTRAINTSENTRY']._serialized_end=2736 68 _globals['_MODELPROTO_SECONDORDERCONECONSTRAINTSENTRY']._serialized_start=2739 69 _globals['_MODELPROTO_SECONDORDERCONECONSTRAINTSENTRY']._serialized_end=2876 70 _globals['_MODELPROTO_SOS1CONSTRAINTSENTRY']._serialized_start=2878 71 _globals['_MODELPROTO_SOS1CONSTRAINTSENTRY']._serialized_end=2992 72 _globals['_MODELPROTO_SOS2CONSTRAINTSENTRY']._serialized_start=2994 73 _globals['_MODELPROTO_SOS2CONSTRAINTSENTRY']._serialized_end=3108 74 _globals['_MODELPROTO_INDICATORCONSTRAINTSENTRY']._serialized_start=3110 75 _globals['_MODELPROTO_INDICATORCONSTRAINTSENTRY']._serialized_end=3235 76# @@protoc_insertion_point(module_scope)
As used below, we define "#variables" = size(VariablesProto.ids).
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
As used below, we define "#linear constraints" = size(LinearConstraintsProto.ids).
A single quadratic constraint of the form:
lb <= sum{linear_terms} + sum{quadratic_terms} <= ub.
If a variable involved in this constraint is deleted, it is treated as if it were set to zero.
A single second-order cone constraint of the form:
||arguments_to_norm
||_2 <= upper_bound
,
where upper_bound
and each element of arguments_to_norm
are linear
expressions.
If a variable involved in this constraint is deleted, it is treated as if it were set to zero.
Data for representing a single SOS1 or SOS2 constraint.
If a variable involved in this constraint is deleted, it is treated as if it were set to zero.
Data for representing a single indicator constraint of the form:
Variable(indicator_id) = (activate_on_zero ? 0 : 1) ⇒ lower_bound <= expression <= upper_bound.
If a variable involved in this constraint (either the indicator, or appearing
in expression
) is deleted, it is treated as if it were set to zero. In
particular, deleting the indicator variable means that the indicator
constraint is vacuous if activate_on_zero
is false, and that it is
equivalent to a linear constraint if activate_on_zero
is true.
An optimization problem.
MathOpt supports:
- Continuous and integer decision variables with optional finite bounds.
- Linear and quadratic objectives (single or multiple objectives), either minimized or maximized.
- A number of constraints types, including:
- Linear constraints
- Quadratic constraints
- Second-order cone constraints
- Logical constraints > SOS1 and SOS2 constraints > Indicator constraints
By default, constraints are represented in "id-to-data" maps. However, we represent linear constraints in a more efficient "struct-of-arrays" format.
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.