Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  using the IloOplModel class

    Posted 10/24/09 07:51 PM

    Originally posted by: SystemAdmin


    [adgro said:]

    It seems that code like
    ...
    var source = new IloOplModelSource(modelName);
    var def = new IloOplModelDefinition(source);
    ...
    only can be used in a main {...} block.

    If I put it in an execute {...} block then
    I got the error:
    Element "IloOplModelSource" does not exist in OPL model

    Problem is: I would like to put the code in a separate .mod file
    and include that model file in my 'main file', like:

    include "run-model-infos.mod";

    main {
      // real main:
      ...
    }

    Now, there can be only one "main { ... }" block and thus
    no main block in the file "run-model-infos.mod".

    So I am stuck on this.
    Anyone knows how to solve this?
    Why is using a IloOplModelSource not possible in a execute block??

    Regards,
    Ad.

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: using the IloOplModel class

    Posted 10/29/09 09:39 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    Hello there,
    execute blocks are used to pre-process data and post-process solution for printing. On the other hand main is used for building algorithmic logic. So if you want to manipulate a model element or solve a model you are supposed to do so when you build the algorithmic logic (therefore in a main) not in an execution block.
    well, if you could outline why (and what) you want to do something with an opl model in an execution block then I might even be able to help (or maybe say straight that it is not possible).


    cheers

    #DecisionOptimization
    #OPLusingCPLEXOptimizer