Skip to content

DimensionDefinition class

Represents the definition of a dimension in an optimization model.

It provides a way to define the characteristics of a dimension, such as its name, display name, minimum and maximum values allowed.

Source code in pyorlib/structures/definitions/dimension_definition.py
@dataclass(frozen=True)
class DimensionDefinition:
    """
    Represents the definition of a dimension in an optimization model.

    It provides a way to define the characteristics of a dimension, such as its name, display name,
    minimum and maximum values allowed.
    """

    name: str
    """ The name of the dimension. """

    display_name: str | None = None
    """ The name of the dimension as it should be displayed to the user. """

    min: float | int | None = 1
    """ The minimum value allowed for the dimension. """

    max: float | int | None = None
    """ The maximum value allowed for the dimension. """

Attributes

name instance-attribute

name: str

The name of the dimension.

display_name class-attribute instance-attribute

display_name: str | None = None

The name of the dimension as it should be displayed to the user.

min class-attribute instance-attribute

min: float | int | None = 1

The minimum value allowed for the dimension.

max class-attribute instance-attribute

max: float | int | None = None

The maximum value allowed for the dimension.

Functions

__init__

__init__(name: str, display_name: str | None = None, min: float | int | None = 1, max: float | int | None = None) -> None