SetAlias Method

Overload List

Alias Creates and returns an alias of the set.

Alias allows to reuse a set definition in different places; such as i and j in the following flow balance constraint example.

C#
int numNodes = 10;
Set i = Set("i").Represents("A node of the network").HasElementsUntil(numNodes);
Set j = i.Alias();

Constraint flowBal = forall(i)
                    | sum(over(j), x[i, j]) == sum(over(j), x[j, i]) + supply[i];
Alias(String) Creates and returns an alias of the set; however with a new key (recommended).

Alias allows to reuse a set definition in different places; such as i and j in the following flow balance constraint example.

C#
int numNodes = 10;
Set i = Set("i").Represents("A node of the network").HasElementsUntil(numNodes);
Set j = i.Alias("j");

Constraint flowBal = forall(i)
                    | sum(over(j), x[i, j]) == sum(over(j), x[j, i]) + supply[i];

See Also