Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  paasing data to cp model from the main model

    Posted 05/06/09 02:46 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    i have the following code:

    [i]  var cpConfig0 = new IloOplRunConfiguration("btpair.mod", "basicData.dat");
      var cpModel0 = cpConfig0.oplModel;
      var cpData0 = cpModel0.dataElements;
     
            cpData0.nSeq=10;
            cpModel0.addDataSource(cpData0);
            cpModel0.generate();[/i]


    in the basicData i have the following assignment:
    nSeq=20;

    why the btpair use 20 and not 10.  i want to give the nSeq variable initial value and be able to change it however i want.

    thanks in advanced
    shadi
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: paasing data to cp model from the main model

    Posted 05/07/09 02:03 PM

    Originally posted by: SystemAdmin


    [fwagner@Ilog.fr said:]

    You cannot regenerate an OPL model.
    Getting data elements from an OPL model triggers its generation, in order to have all data available.

    If you want to reinstantiate a model with modified data, you need a new object.

    Something like:
      var cpModel1 = new IloOplModel(cpModel0.modelDefinition);
      cpData0.nSeq=10;
      cpModel1.addDataSource(cpData0);
      cpModel1.generate();




    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: paasing data to cp model from the main model

    Posted 05/08/09 12:21 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    thank you Frank

    shadi
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: paasing data to cp model from the main model

    Posted 07/23/09 12:21 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    Dear Frank,
    i thought that i solved this problem using another way, but now When generateing the odm application from my project i can see that the way that i followed is not correct, i want to pass parameters from the scenario to this model, my current code is:


      var cpConfig0 = new IloOplRunConfiguration("btpair.mod", "basicData.dat");
      var cpModel0 = cpConfig0.oplModel;
      var cpData0 = cpModel0.dataElements;
     
        // i want to pass many data here in order to initialize my global data like :
        cpData0.nSeq=10;

        cpModel0.addDataSource(cpData0);
        cpModel0.generate();


    and the btpair model use only the data from the basicData data file and not the data that i passed before the generate function (nSeq=20 and not 10).

    can you explain to me how i can do that in details, becuase i have not only simple variable like nSeq, i have more complex data structures like tupleset and arrays, and i want pass these data from database from the odm.
    where to add the code that you sent? after the  cpModel0.generate(); command?

    thanks in advanced
    Kshieboun Shadi



    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: paasing data to cp model from the main model

    Posted 07/27/09 05:15 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    hi,
    i solved this problem.

    shadi
    #DecisionOptimization
    #OPLusingCPOptimizer