Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Can an IloIntVarArray be converted to an IlcIntVarArray?

  • 1.  Can an IloIntVarArray be converted to an IlcIntVarArray?

    Posted Fri February 20, 2015 01:13 PM

    Originally posted by: ncg777


    Hi!

    I'm porting rather old C++ code from using ILOG Solver to using CP Optimizer. I figured that I need to use the CP Optimizer Extensions API to do that. But it gets a little bit complicated.

    Somewhere in the code, there are calls to IloBestGenerate, but it seems this function does not exist anymore. The closest replacement I found was IlcBestGenerate, but it takes an IlcIntVarArray as input and what I got is an IloIntVarArray. I tried to change the type of my array from an IloIntVarArray to an IlcIntVarArray, but it has a cascading effect that forces me to change the types of other variables from the Ilo... types to the Ilc... types, until I hit a dead end where an IloIntExpr needs to be converted to an Ilc... type. I tried IlcIntExp, but the code uses an overload of += that IlcIntExp does not seem to have.

    Can I and if so how can I convert an IloIntVarArray to an IlcIntVarArray? I think that it would solve the problem right away.

    I'm not very experienced with this technology. I still have much to learn. Any help, any clue would be very nice.


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Can an IloIntVarArray be converted to an IlcIntVarArray?

    Posted Fri February 20, 2015 03:10 PM

    Originally posted by: PhilippeGr


    Hi,

    IloXXX are modelling objects when IlcXXX are engine objects. IlcObjects are extracted from IloObjects.
    I advise you to take a look at the CP Optimizer Extensions User's Manual - Chapter 3  ( http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.1/ilog.odms.studio.help/pdf/advcpoptimizer.pdf ), this should clarify the difference and link between Ilo and Ilc Objects.

    I have never worked with BestGenerate, so I cannot help you with that part of your question.

     

     


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Can an IloIntVarArray be converted to an IlcIntVarArray?

    Posted Fri February 20, 2015 04:45 PM

    Originally posted by: ncg777


    That's exactly what I needed. Thanks for pointing it out.

    I converted my IloIntVarArray variable to an IlcIntVarArray using IloCP::getIntVarArray.


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Can an IloIntVarArray be converted to an IlcIntVarArray?

    Posted Tue February 24, 2015 10:56 AM

    Originally posted by: ChrisBr


    Hello Nicolas,

    You might have a look at this presentation:

    Migrating from ILOG CP (Solver/Scheduler) to CP Optimizer

    (November 19, 2014 - Jerome Rogerie, IBM Software Group - Constraint Programming Development)

    I hope this helps,

    Chris.


    #CPOptimizer
    #DecisionOptimization