Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only

How to include additional constraints from a file ?

  • 1.  How to include additional constraints from a file ?

    Posted 10/16/17 04:07 AM

    Hi,

    sub.mod

    subject to
    {
    x<=2;
    }

    and then the main.mod

    dvar int x;

    maximize x;
    subject to
    {
    x<=3;
    }

    include "sub.mod";

    execute
    {
    writeln("x=",x);
    }

    gives

    x=2

    which shows how easy it is to add additional constraints through include

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer