echo.models.agnostic.tellegen.partitioned_multi_commodity module

class echo.models.agnostic.tellegen.partitioned_multi_commodity.PartitionedMultiCommodityTellegenNode(uid: str = NOTHING, node_name: str = NOTHING, ports: dict[str, Port] = NOTHING, objective: NumericExpression | float = 0, partitions: dict[str, list[Port]] = NOTHING, default_partition: str = 'default_partition')

Bases: Node

A node with partitions of ports, ports in each partition may have multiple commodities. A tellegen constraint is applied per partition per commodity.

add_port(name: str, port: Port, partition: str | None = None) → None

Override base add_port method, add addition argument which is partition name to which add the port.

If partition is not specified, adds to the default partition.

apply_node_constraints(model: EchoConcreteModel) → None

Apply Tellegen constraint for same commodity ports within each partition.

default_partition: str
partitions: dict[str, list[Port]]