ParametricInstance

class ParametricInstance
__copy__() ParametricInstance
__deepcopy__(_memo: Any) ParametricInstance
add_user_annotation(key: str, value: str, annotation_namespace: str = 'org.ommx.user.') None
add_user_annotations(annotations: Mapping[str, str], annotation_namespace: str = 'org.ommx.user.') None
empty() ParametricInstance

Create trivial empty instance of minimization with zero objective, no constraints, and no decision variables and parameters.

from_bytes(bytes: bytes) ParametricInstance
from_components(sense: Sense, objective: ToFunction, decision_variables: Sequence[DecisionVariable], constraints: Sequence[Constraint], parameters: Sequence[Parameter], named_functions: Optional[Sequence[NamedFunction]] = None, description: Optional[InstanceDescription] = None, constraint_hints: Optional[ConstraintHints] = None) ParametricInstance
get_constraint_by_id(constraint_id: int) Constraint

Get a specific constraint by ID

get_decision_variable_by_id(variable_id: int) DecisionVariable

Get a specific decision variable by ID

get_named_function_by_id(named_function_id: int) NamedFunction

Get a specific named function by ID

get_parameter_by_id(parameter_id: int) Parameter

Get a specific parameter by ID

get_removed_constraint_by_id(constraint_id: int) RemovedConstraint

Get a specific removed constraint by ID

get_user_annotation(key: str, annotation_namespace: str = 'org.ommx.user.') str
get_user_annotations(annotation_namespace: str = 'org.ommx.user.') dict[str, str]
to_bytes() bytes
with_parameters(parameters: Mapping[int, float]) Instance

Substitute parameters to yield an instance.

Parameters can be provided as a dict mapping parameter IDs to their values.

property annotations: dict[str, str]

Returns a copy of the annotations dictionary.

Mutating the returned dict will not update the object. Use add_user_annotation() or assign to annotations to modify annotations.

property authors: list[str]
property constraint_hints: ConstraintHints

Read-only property.

property constraints: list[Constraint]

Read-only property.

property constraints_df: DataFrame

Read-only property.

DataFrame of constraints

property created: Optional[datetime]
property dataset: Optional[str]
property decision_variable_ids: set[int]

Read-only property.

property decision_variables: list[DecisionVariable]

Read-only property.

property decision_variables_df: DataFrame

Read-only property.

DataFrame of decision variables

property description: Optional[InstanceDescription]

Read-only property.

property license: Optional[str]
property named_functions: list[NamedFunction]

Read-only property.

property named_functions_df: DataFrame

Read-only property.

DataFrame of named functions

property num_constraints: Optional[int]
property num_variables: Optional[int]
property objective: Function

Read-only property.

property parameter_ids: set[int]

Read-only property.

property parameters: list[Parameter]

Read-only property.

property parameters_df: DataFrame

Read-only property.

DataFrame of parameters

property removed_constraints: list[RemovedConstraint]

Read-only property.

property removed_constraints_df: DataFrame

Read-only property.

DataFrame of removed constraints

property sense: Sense

Read-only property.

property title: Optional[str]