ommx.v1.named_function_pb2

Classes

EvaluatedNamedFunction

A named function evaluated with a state

NamedFunction

Named Function

Module Contents

class ommx.v1.named_function_pb2.EvaluatedNamedFunction(*, id: int = ..., 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 = ...)

A named function 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
ClearField(field_name: Literal['_description', b'_description', '_name', b'_name', 'description', b'description', 'evaluated_value', b'evaluated_value', 'id', b'id', 'name', b'name', 'parameters', b'parameters', 'subscripts', b'subscripts', 'used_decision_variable_ids', b'used_decision_variable_ids']) None
HasField(field_name: Literal['_description', b'_description', '_name', b'_name', 'description', b'description', '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
EVALUATED_VALUE_FIELD_NUMBER: int
ID_FIELD_NUMBER: int
NAME_FIELD_NUMBER: int
PARAMETERS_FIELD_NUMBER: int
SUBSCRIPTS_FIELD_NUMBER: int
USED_DECISION_VARIABLE_IDS_FIELD_NUMBER: int
description: str

Detail human-readable description of the named function.

evaluated_value: float
id: int
name: str

Name of the named function.

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

Key-value parameters of the named function.

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

Integer parameters of the named function.

Consider for example a problem contains a series of named functions x[i, j] + y[i, j] for i = 1, 2, 3 and j = 4, 5, then 6 = 3x2 NamedFunction 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], and the subscripts field is intended to be the value of [i, j] like [1, 5].

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

IDs of decision variables used to evaluate this named function

class ommx.v1.named_function_pb2.NamedFunction(*, id: int = ..., 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 = ...)

Named Function

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', '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
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 named function.

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

Named Function ID

  • Named Function 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 named function x * 2 with named function ID 1.

  • IDs are not required to be sequential.

  • IDs must be unique with other types of constraints.

name: str

Name of the named function.

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

Key-value parameters of the named function.

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

Integer parameters of the named function.

Consider for example a problem contains a series of named functions x[i, j] + y[i, j] for i = 1, 2, 3 and j = 4, 5, then 6 = 3x2 NamedFunction 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], and the subscripts field is intended to be the value of [i, j] like [1, 5].