Topic
  • 4 replies
  • Latest Post - ‏2013-04-29T18:06:41Z by Aaronlidebiao
Aaronlidebiao
Aaronlidebiao
8 Posts

Pinned topic How to see the solution during the search?

‏2013-04-26T01:41:01Z |

Hi, 

I used CPLEX ILOG 12.5. If I program by Mathematical model, I can see the solution by execute the scripting log.

But I switch the model to using CP. I couldn't see the solution during the search by the same execute display code.

Could you tell me how to see solutions during the search?

Thanks.

 

  • ChrisBr
    ChrisBr
    60 Posts
    ACCEPTED ANSWER

    Re: How to see the solution during the search?

    ‏2013-04-29T16:41:51Z  

    Hi Chris,

    Thanks for your reply.

    My execute display code written as

    "

    execute DISPLAY {

      {writeln("Sequantial variable ")};
      for(var k in K)
        for(var j in J)
        for(var i in I) 
        if (x[i][j][k]==1) {writeln("Cycle ", k," Position ",j, " is point  ",i)};
     
    {writeln("Assignment ")};
       for (var l in L)
       for (var m in M)
        if (y[l][m]==1){writeln("Part ", m, " assigned to ", l)}

    }

    "

    It works fine when I used the MIP to solve the problem, but when I used the CP. There is no solution display in the "Scripting Log". Do you know why?

    Thanks.

    Hello,

    Sorry, I badly expressed myself. I meant:
           "Could you provide us your whole model, including the execute display?"
    No matter, you have given your model in another thread...

    I think that the solution is not displayed because the engine has not found any solution.
    If you are sure that there is one, this can come from a search limit (time, or something else), or (cf your other post) from a memory problem (it seems that, depending on the engine used, your model reaches the memory limit or not).

    Could you post your question in the dedicated forum:  Constraint Programming >‎OPL using CP Optimizer (https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002067), please? There could be some OPL specialists who would be able to give you more accurate advices.

    Regards,

    Chris
     

  • ChrisBr
    ChrisBr
    60 Posts

    Re: How to see the solution during the search?

    ‏2013-04-29T13:07:09Z  

    Hello,

    I'm not sure I understand your problem.
    How is the execute display code written?
    Could you provide us your model - with the execute display?

    By the way, in case you are using OPL, it would be better to post your question in the dedicated forum:  Constraint Programming >‎OPL using CP Optimizer

    Regards,

    Chris
     

  • Aaronlidebiao
    Aaronlidebiao
    8 Posts

    Re: How to see the solution during the search?

    ‏2013-04-29T15:37:31Z  
    • ChrisBr
    • ‏2013-04-29T13:07:09Z

    Hello,

    I'm not sure I understand your problem.
    How is the execute display code written?
    Could you provide us your model - with the execute display?

    By the way, in case you are using OPL, it would be better to post your question in the dedicated forum:  Constraint Programming >‎OPL using CP Optimizer

    Regards,

    Chris
     

    Hi Chris,

    Thanks for your reply.

    My execute display code written as

    "

    execute DISPLAY {

      {writeln("Sequantial variable ")};
      for(var k in K)
        for(var j in J)
        for(var i in I) 
        if (x[i][j][k]==1) {writeln("Cycle ", k," Position ",j, " is point  ",i)};
     
    {writeln("Assignment ")};
       for (var l in L)
       for (var m in M)
        if (y[l][m]==1){writeln("Part ", m, " assigned to ", l)}

    }

    "

    It works fine when I used the MIP to solve the problem, but when I used the CP. There is no solution display in the "Scripting Log". Do you know why?

    Thanks.

  • ChrisBr
    ChrisBr
    60 Posts

    Re: How to see the solution during the search?

    ‏2013-04-29T16:41:51Z  

    Hi Chris,

    Thanks for your reply.

    My execute display code written as

    "

    execute DISPLAY {

      {writeln("Sequantial variable ")};
      for(var k in K)
        for(var j in J)
        for(var i in I) 
        if (x[i][j][k]==1) {writeln("Cycle ", k," Position ",j, " is point  ",i)};
     
    {writeln("Assignment ")};
       for (var l in L)
       for (var m in M)
        if (y[l][m]==1){writeln("Part ", m, " assigned to ", l)}

    }

    "

    It works fine when I used the MIP to solve the problem, but when I used the CP. There is no solution display in the "Scripting Log". Do you know why?

    Thanks.

    Hello,

    Sorry, I badly expressed myself. I meant:
           "Could you provide us your whole model, including the execute display?"
    No matter, you have given your model in another thread...

    I think that the solution is not displayed because the engine has not found any solution.
    If you are sure that there is one, this can come from a search limit (time, or something else), or (cf your other post) from a memory problem (it seems that, depending on the engine used, your model reaches the memory limit or not).

    Could you post your question in the dedicated forum:  Constraint Programming >‎OPL using CP Optimizer (https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002067), please? There could be some OPL specialists who would be able to give you more accurate advices.

    Regards,

    Chris
     

  • Aaronlidebiao
    Aaronlidebiao
    8 Posts

    Re: How to see the solution during the search?

    ‏2013-04-29T18:06:41Z  
    • ChrisBr
    • ‏2013-04-29T16:41:51Z

    Hello,

    Sorry, I badly expressed myself. I meant:
           "Could you provide us your whole model, including the execute display?"
    No matter, you have given your model in another thread...

    I think that the solution is not displayed because the engine has not found any solution.
    If you are sure that there is one, this can come from a search limit (time, or something else), or (cf your other post) from a memory problem (it seems that, depending on the engine used, your model reaches the memory limit or not).

    Could you post your question in the dedicated forum:  Constraint Programming >‎OPL using CP Optimizer (https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002067), please? There could be some OPL specialists who would be able to give you more accurate advices.

    Regards,

    Chris
     

    Hi Chris, 

    Sure. Thanks.

    Regards,

    Aaron