Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Optimization tasks in cycle

    Posted 11/21/10 12:48 PM

    Originally posted by: apscomeup


    Hi! I need to solve optimization tasks in cycle. So have some questions.
    1. Is it possible to change objective function and use only one .mod file?
    Possible to define objective in cycle or to define them in .mod file using 'dexpr' type and run needed objective or there exists some other ways.

    2. Another matter, is it possible to define (or redefine) parameters values which are used in the .mod file. When i try to do it you can see the comment '//opl.pTest = 3;' I have an error that it is not allowed to define via flow control.

    3. The last, is it possible to write results from flow control to Access database or the unique way is using 'opl.postProcess();' and define commands to write data in .dat file as i've done in code below
    }
    main {
    for (var s = 1; s <= 2; s++)
    {
    var source = new IloOplModelSource("prtOptim.mod");
    var cplex = new IloCplex();
    var def = new IloOplModelDefinition(source);
    var opl = new IloOplModel(def,cplex);
    var data = new IloOplDataSource("prtOptim.dat");
    opl.addDataSource(data);
    opl.generate();
    //opl.pTest = 3;
    //opl.ACTIVESCENES = {1,2,3,4,5};
    opl.ACTIVESCENES.add(s);
    var res = cplex.solve();
    writeln("Yeeeh babyMM!");
    writeln(res);
    writeln(opl.ACTIVESCENES);
    //writeln(cplex.getObjValue());
    opl.postProcess();
    };
    };
    {code}

    Thank you!
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Optimization tasks in cycle

    Posted 11/21/10 12:49 PM

    Originally posted by: apscomeup


    main {
    for (var s = 1; s <= 2; s++)
    {
    var source = new IloOplModelSource("prtOptim.mod");
    var cplex = new IloCplex();
    var def = new IloOplModelDefinition(source);
    var opl = new IloOplModel(def,cplex);
    var data = new IloOplDataSource("prtOptim.dat");
    opl.addDataSource(data);
    opl.generate();
    //opl.pTest = 3;
    //opl.ACTIVESCENES = {1,2,3,4,5};
    opl.ACTIVESCENES.add(s);
    var res = cplex.solve();
    writeln("Yeeeh babyMM!");
    writeln(res);
    writeln(opl.ACTIVESCENES);
    //writeln(cplex.getObjValue());
    opl.postProcess();
    };
    };
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Optimization tasks in cycle

    Posted 11/21/10 01:45 PM

    Originally posted by: SystemAdmin


    Sounds like a question that you will be answered more likely in the OPL/CPLEX forum at http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2053
    If you do not get replys here, try reposting there.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Optimization tasks in cycle

    Posted 11/22/10 01:26 AM

    Originally posted by: apscomeup


    thank you! sorry that i've taken you time.
    if possible, say please where can i find the list of forums concerning CPLEX and OPL development, can not find it.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Optimization tasks in cycle

    Posted 11/22/10 04:08 AM

    Originally posted by: SystemAdmin


    Start here. CPLEX and OPL/CPLEX are a sub-forum of "Mathematical Programming".
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Optimization tasks in cycle

    Posted 11/22/10 05:20 AM

    Originally posted by: apscomeup


    Thank you very much!
    #CPLEXOptimizers
    #DecisionOptimization