Decision Optimization

 View Only
  • 1.  CP Model: Oplide becomes unresponsive while printing solutions

    Posted Tue June 21, 2022 09:25 AM
    Hi,

    I, Akshat, am a student at the Indian Institute of Technology Bombay, working on a university project involving CPLEX Optimization Studio 22.1.0 (academic).

    I'm facing an issue retrieving all the feasible solutions to the constraint programming model formulated in the studio, as the Oplide becomes unresponsive while printing the solutions in the scripting log tab.

    Device specification: macOS Monterey, 8GB RAM, 1.8GHz Dual-Core Intel i5 processor

    I'm attaching the model and data file for anyone who wants to reproduce the issue.

    I would greatly appreciate any lead to this issue. Thanks!

    ------------------------------
    Akshat Bansal
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CP Model: Oplide becomes unresponsive while printing solutions

    Posted Wed June 22, 2022 01:59 AM
    Hi

    if you change your main into

    main{
    thisOplModel.generate();
    var n=100;
    var i=0;
    cp.startNewSearch();
    while
    (cp.next() && (i<=n)) {thisOplModel.postProcess(); i++; }
    }​


    OPL will stop after 100 solutions. (In a few seconds)

    You can change n for more.

    regards



    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: CP Model: Oplide becomes unresponsive while printing solutions

    Posted Wed June 22, 2022 09:11 AM
    Thanks for a quick response!

    I changed the main block in the model and set the value of n as 7000. I guess the solver generated all the feasible solutions; however, it then became unresponsive (screenshot attached). Thus, I could not access the solutions in the scripting log.

    Regards,
    Akshat

    ------------------------------
    Akshat Bansal
    ------------------------------



  • 4.  RE: CP Model: Oplide becomes unresponsive while printing solutions

    Posted Wed June 22, 2022 09:23 AM
    Hi,

    this works fine on my machine.

    If I use

    main{
    thisOplModel.generate();
    var n=7000;
    var i=0;
    cp.startNewSearch();
    while
    (cp.next() && (i<=n)) {thisOplModel.postProcess(); i++; writeln(i); }
    }​

    I get

    6997
     [43 100 153 153]
    6998
     [43 92 153 153]
    6999
     [43 112 153 153]
    7000
     [43 111 153 153]
    7001



    So what you could do is:

    - use a more powerful machine
    - use oplrun instead of the IDE
    - try to use only 1 worker

    main{
      cp.param.workers=1;
    thisOplModel.generate();
    var n=7000;
    var i=0;
    cp.startNewSearch();
    while
    (cp.next() && (i<=n)) {thisOplModel.postProcess(); i++; writeln(i); }
    }










    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 5.  RE: CP Model: Oplide becomes unresponsive while printing solutions

    Posted Thu June 23, 2022 12:24 AM
    Edited by System Fri January 20, 2023 04:33 PM
    Hi,

    Can you comment on whether this issue that it generates all the solutions but then becomes unresponsive (screenshot attached) is of IDE or device? (I'm using a device having macOS, 8 GB RAM, 128 GB Storage and 1.8 GHz Dual-Core Processor)

    Regards

    ------------------------------
    Akshat Bansal
    ------------------------------