ommx.v1.constraint_pb2

Attributes

EQUALITY_EQUAL_TO_ZERO

EQUALITY_LESS_THAN_OR_EQUAL_TO_ZERO

EQUALITY_UNSPECIFIED

Classes

Constraint

Equality

Equality of a constraint.

EvaluatedConstraint

A constraint evaluated with a state

RemovedConstraint

Module Contents

class ommx.v1.constraint_pb2.Constraint(*, id: int = ..., equality: global___Equality = ..., function: ommx.v1.function_pb2.Function | None = ..., subscripts: collections.abc.Iterable[int] | None = ..., parameters: collections.abc.Mapping[str, str] | None = ..., name: str | None = ..., description: str | None = ...)
class ParametersEntry(*, key: str = ..., value: str = ...)
ClearField(field_name: Literal['key', b'key', 'value', b'value']) None
KEY_FIELD_NUMBER: int
VALUE_FIELD_NUMBER: int
key: str
value: str
ClearField(field_name: Literal['_description', b'_description', '_name', b'_name', 'description', b'description', 'equality', b'equality', 'function', b'function', 'id', b'id', 'name', b'name', 'parameters', b'parameters', 'subscripts', b'subscripts']) None
HasField(field_name: Literal['_description', b'_description', '_name', b'_name', 'description', b'description', 'function', b'function', 'name', b'name']) bool
WhichOneof(oneof_group: Literal['_description', b'_description']) Literal['description'] | None
WhichOneof(oneof_group: Literal['_name', b'_name']) Literal['name'] | None
DESCRIPTION_FIELD_NUMBER: int
EQUALITY_FIELD_NUMBER: int
FUNCTION_FIELD_NUMBER: int
ID_FIELD_NUMBER: int
NAME_FIELD_NUMBER: int
PARAMETERS_FIELD_NUMBER: int
SUBSCRIPTS_FIELD_NUMBER: int
description: str

Detail human-readable description of the constraint.

equality: global___Equality
property function: ommx.v1.function_pb2.Function
id: int

Constraint ID

  • Constraint IDs are managed separately from decision variable IDs. We can use the same ID for both. For example, we have a decision variable x with decision variable ID 1` and constraint x == 0 with constraint ID 1.

  • IDs are not required to be sequential.

  • IDs must be unique with other types of constraints.

name: str

Name of the constraint.

property parameters: google.protobuf.internal.containers.ScalarMap[str, str]

Key-value parameters of the constraint.

property subscripts: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

Integer parameters of the constraint.

Consider for example a problem constains a series of constraints x[i, j] + y[i, j] <= 10 for i = 1, 2, 3 and j = 4, 5, then 6 = 3x2 Constraint messages should be created corresponding to each pair of i and j. The name field of this message is intended to be a human-readable name of x[i, j] + y[i, j] <= 10, and the subscripts field is intended to be the value of [i, j] like [1, 5].

class ommx.v1.constraint_pb2.Equality

Equality of a constraint.

V: TypeAlias = ValueType
ValueType
class ommx.v1.constraint_pb2.EvaluatedConstraint(*, id: int = ..., equality: global___Equality = ..., evaluated_value: float = ..., used_decision_variable_ids: collections.abc.Iterable[int] | None = ..., subscripts: collections.abc.Iterable[int] | None = ..., parameters: collections.abc.Mapping[str, str] | None = ..., name: str | None = ..., description: str | None = ..., dual_variable: float | None = ..., removed_reason: str | None = ..., removed_reason_parameters: collections.abc.Mapping[str, str] | None = ...)

A constraint evaluated with a state

class ParametersEntry(*, key: str = ..., value: str = ...)
ClearField(field_name: Literal['key', b'key', 'value', b'value']) None
KEY_FIELD_NUMBER: int
VALUE_FIELD_NUMBER: int
key: str
value: str
class RemovedReasonParametersEntry(*, key: str = ..., value: str = ...)
ClearField(field_name: Literal['key', b'key', 'value', b'value']) None
KEY_FIELD_NUMBER: int
VALUE_FIELD_NUMBER: int
key: str
value: str
ClearField(field_name: Literal['_description', b'_description', '_dual_variable', b'_dual_variable', '_name', b'_name', '_removed_reason', b'_removed_reason', 'description', b'description', 'dual_variable', b'dual_variable', 'equality', b'equality', 'evaluated_value', b'evaluated_value', 'id', b'id', 'name', b'name', 'parameters', b'parameters', 'removed_reason', b'removed_reason', 'removed_reason_parameters', b'removed_reason_parameters', 'subscripts', b'subscripts', 'used_decision_variable_ids', b'used_decision_variable_ids']) None
HasField(field_name: Literal['_description', b'_description', '_dual_variable', b'_dual_variable', '_name', b'_name', '_removed_reason', b'_removed_reason', 'description', b'description', 'dual_variable', b'dual_variable', 'name', b'name', 'removed_reason', b'removed_reason']) bool
WhichOneof(oneof_group: Literal['_description', b'_description']) Literal['description'] | None
WhichOneof(oneof_group: Literal['_dual_variable', b'_dual_variable']) Literal['dual_variable'] | None
WhichOneof(oneof_group: Literal['_name', b'_name']) Literal['name'] | None
WhichOneof(oneof_group: Literal['_removed_reason', b'_removed_reason']) Literal['removed_reason'] | None
DESCRIPTION_FIELD_NUMBER: int
DUAL_VARIABLE_FIELD_NUMBER: int
EQUALITY_FIELD_NUMBER: int
EVALUATED_VALUE_FIELD_NUMBER: int
ID_FIELD_NUMBER: int
NAME_FIELD_NUMBER: int
PARAMETERS_FIELD_NUMBER: int
REMOVED_REASON_FIELD_NUMBER: int
REMOVED_REASON_PARAMETERS_FIELD_NUMBER: int
SUBSCRIPTS_FIELD_NUMBER: int
USED_DECISION_VARIABLE_IDS_FIELD_NUMBER: int
description: str

Detail human-readable description of the constraint.

dual_variable: float

Value for the Lagrangian dual variable of this constraint. This is optional because not all solvers support to evaluate dual variables.

equality: global___Equality
evaluated_value: float

The value of function for the state

id: int
name: str

Name of the constraint.

property parameters: google.protobuf.internal.containers.ScalarMap[str, str]

Key-value parameters of the constraint.

removed_reason: str

Short removed reason of the constraint. This field exists only if this message is evaluated from a removed constraint.

property removed_reason_parameters: google.protobuf.internal.containers.ScalarMap[str, str]

Detailed parameters why the constraint is removed. This field exists only if this message is evaluated from a removed constraint.

property subscripts: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

Integer parameters of the constraint.

property used_decision_variable_ids: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

IDs of decision variables used to evalute this constraint

class ommx.v1.constraint_pb2.RemovedConstraint(*, constraint: global___Constraint | None = ..., removed_reason: str = ..., removed_reason_parameters: collections.abc.Mapping[str, str] | None = ...)
class RemovedReasonParametersEntry(*, key: str = ..., value: str = ...)
ClearField(field_name: Literal['key', b'key', 'value', b'value']) None
KEY_FIELD_NUMBER: int
VALUE_FIELD_NUMBER: int
key: str
value: str
ClearField(field_name: Literal['constraint', b'constraint', 'removed_reason', b'removed_reason', 'removed_reason_parameters', b'removed_reason_parameters']) None
HasField(field_name: Literal['constraint', b'constraint']) bool
CONSTRAINT_FIELD_NUMBER: int
REMOVED_REASON_FIELD_NUMBER: int
REMOVED_REASON_PARAMETERS_FIELD_NUMBER: int
property constraint: global___Constraint

The removed constraint

removed_reason: str

Short reason why the constraint was removed.

This should be the name of method, function or application which remove the constraint.

property removed_reason_parameters: google.protobuf.internal.containers.ScalarMap[str, str]

Arbitrary key-value parameters representing why the constraint was removed.

This should be human-readable and can be used for debugging.

ommx.v1.constraint_pb2.EQUALITY_EQUAL_TO_ZERO: Equality
ommx.v1.constraint_pb2.EQUALITY_LESS_THAN_OR_EQUAL_TO_ZERO: Equality
ommx.v1.constraint_pb2.EQUALITY_UNSPECIFIED: Equality