Topic
  • 3 replies
  • Latest Post - ‏2015-02-13T15:49:17Z by AlexFleischer
MBEUTCHA
MBEUTCHA
5 Posts

Pinned topic Lazy Constraints using OPL?

‏2014-05-22T16:14:06Z |

Hello,

I want to know if with the new releases of Cplex, it is currently possible to implement lazy constraints using OPL Script ? As I looked around, someone already asked this question on the forum ( https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014412146 ) and get the answer it wasn't possible.

I tried to add lazy constraints using the method IloCplex::addLazyConstraint( IloConstraint con), but I get an assertion failed error 

Erreur interne : ASSERTION FAILED à l'emplacement E:\SF\s80\builds32\workspace\RB.opl_lang-wks.x86_windows_vs2010\opl_lang\include\ilopl/script/proxies.h:946.

but unfortunately, I couldn't figure out what that error is, I guess it deals with the way Windows handle procedures.

As we should add lazy constraint after we generate the model, we need to create them in the main script bloc, but the properties IloConstraint or even IloRange do not have any constructor available, so it's virtually impossible to create such elements outside the model, Am I wrong?

Does somebody have an example of JAVA/.NET/C++ opl interfaces examples using lazy constraints? I looked on the examples files but I couldn't find any?

I would appreciate any help.

Thanks.

  • davidoff
    davidoff
    55 Posts

    Re: Lazy Constraints using OPL?

    ‏2014-06-11T16:11:45Z  

    Any answer for this question ? I'm interested to know using Scripting too.

    Using API's that should be possible though. Take any Java sample with OPL and adapt it to run your own model, then before solving , remove all the constraints from the model that you would like to manage as lazy constraints (this would be done through loops on the collection of named constraints), then re-add all these constraints as lazy

     

  • AlexFleischer
    AlexFleischer
    1472 Posts

    Re: Lazy Constraints using OPL?

    ‏2014-06-11T19:40:13Z  
    • davidoff
    • ‏2014-06-11T16:11:45Z

    Any answer for this question ? I'm interested to know using Scripting too.

    Using API's that should be possible though. Take any Java sample with OPL and adapt it to run your own model, then before solving , remove all the constraints from the model that you would like to manage as lazy constraints (this would be done through loops on the collection of named constraints), then re-add all these constraints as lazy

     

    Hi,

    I logged a PMR a while ago. This is a bug.

    As a workaround use other APIs

    regards

  • AlexFleischer
    AlexFleischer
    1472 Posts

    Re: Lazy Constraints using OPL?

    ‏2015-02-13T15:49:17Z  

    Hi,

    I logged a PMR a while ago. This is a bug.

    As a workaround use other APIs

    regards

    This is ok now: http://www-01.ibm.com/support/docview.wss?uid=swg1RS01648