Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Find pair nodes (j,i)

    Posted 04/21/17 12:23 PM

    Originally posted by: MachexC


    Hi everyone,

    I have a S variable it is declared as follows:

    tuple  Product_cities {
     int product;
     string cities;
     int time;

    }

    {Product_cities} Product_cities_s   = ...;

    dvar float+ S[<p,j,t> in Product_cities_s];

    Because each type of product will be sold through pairs of cities at each period is different as in Excel file. For example, Product 1 will be sold from Saigon to Cantho in period of 1. However I would like to get variable S in the opposite city pair.

    S (1, Cantho, 1)= S (1, Saigon,1)

    S (2, Cantho, 1)= S (2, Saigon, 1)

    S (3, Soctrang, 2) = S(3, Baclieu,2)

    ....

    I do not know how to write in OPL such results. Do you have any suggestions how to resolve this issue?

     

    Mac

     

     

     

     

     


     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Find pair nodes (j,i)

    Posted 04/21/17 12:46 PM

    Hi,

    you could try to copy your set into a new set

    tuple  Product_cities {
     int product;

    int time;
     string cities;
     

    }

    sorted {Product_cities} Product_cities_s2   =

    So that tuples would be sorted first according to product and then time

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer