Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Creating a set

    Posted 04/21/09 07:39 PM

    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


  • 2.  Re: Creating a set

    Posted 04/23/09 02:49 AM

    Originally posted by: SystemAdmin


    [Brian said:]

    Ok, I found the following solution,


    //Creating a set based on this new tuple
    {DemandCouples}demandcouples = {<i,j> | i in C, j in C: Demand[i][j]>0};

    #DecisionOptimization
    #MathematicalProgramming-General