Topic
2 replies Latest Post - ‏2013-10-11T14:06:17Z by heidizh
heidizh
heidizh
4 Posts
ACCEPTED ANSWER

Pinned topic How to modify the dat elements?

‏2013-10-09T02:49:32Z |

Suppose that I define A=[1,2,3,4,5,6,7,8,9] in a dat. file and I have the value of A in the objective.  I get B=[1,3,5,6,2,9,8,4,7] in the POST-PROCESS. How could I give the value of B to A in the main block  so that I can update the value of A in the objective? Or, does there exist any other methods to modify the dat elements?

Any help will be greatly appreciated.

Best regards,

Heidi

  • DanielJunglas
    DanielJunglas
    110 Posts
    ACCEPTED ANSWER

    Re: How to modify the dat elements?

    ‏2013-10-09T15:41:00Z  in response to heidizh

    You may want to look at class IloCplex and its setObjCoef() member function which allows changing the objective function from within a scripting block.

    In general, your question is OPL related and should therefore be asked on the OPL forum. There you will find the OPL experts who can probably answer your question better than I can.

    • heidizh
      heidizh
      4 Posts
      ACCEPTED ANSWER

      Re: How to modify the dat elements?

      ‏2013-10-11T14:06:17Z  in response to DanielJunglas

       

      Thank you, Daniel. It's very helpful, thank you.