Originally posted by: SystemAdmin
[Brian said:]
Hi all!
I have a set of cities C, and between some of these cities there is a supply/demand relationship i.e. City1 must supply 42 units to city2. These data are given by the parameter Demand[C][C]. Now i want to create a new set that contains the specific pairs of cities that make up a supply/demand pair, but how to do that? I have tried this...
//Tuple: pair of supply/demand node
tuple DemandPairs
{
//supply node
string supNode;
//demand node
string demNode;
}
//Creating a set based on this new tuple
{DemandPairs} demandpairs;
execute {
for(var i in C)
{
for(var j in C)
{
if(Demand[i][j]>0)
{
//demandpairs.supNode=i;
//demandpairs.demNode=j;
//demandpairs(.add)=<i,j>;
}
}
}
}
Is there perhaps some "add" method/function that i can call on the demand set?
Thanks in advance!
#DecisionOptimization#MathematicalProgramming-General