Decision Optimization

 View Only
Expand all | Collapse all

Issues with implenting contraints (time and sets)

  • 1.  Issues with implenting contraints (time and sets)

    Posted Wed July 01, 2020 12:28 PM
    Hi,

    I am new to OPL and I have some issues with the code (please have a look at the attachment)
    It would be great if you can give me some support.

    Thank you very much.
    #DecisionOptimization


  • 2.  RE: Issues with implenting contraints (time and sets)

    Posted Wed July 01, 2020 01:32 PM
    Hi,

    you could use a tuple set for O:

    int k=3;
    
    tuple t
    {
      int i;
      int j;
    }
    
    range TimeFrame = 1..k;
    
    {t} O[TimeFrame]=[{<1,2>},{<2,3>},{<3,4>}];
    
    execute
    {
      writeln(O);
    }
    ​


    works fine

    regards



    ------------------------------
    ALEX FLEISCHER
    ------------------------------