Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

constrains problem

  • 1.  constrains problem

    Posted Wed December 16, 2015 07:34 AM

    Originally posted by: EpiphoneTomato


    how to program this constrain using cp?

     


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: constrains problem

    Posted Wed December 16, 2015 08:16 AM

    Originally posted by: rdumeur


    Hi,

    We need some additional information:


    #DecisionOptimization


  • 3.  Re: 回复:限制问题

    Posted Wed December 16, 2015 09:08 AM

    Originally posted by: EpiphoneTomato



    #DecisionOptimization


  • 4.  Re: constrains problem

    Posted Wed December 16, 2015 10:04 AM

    Originally posted by: rdumeur


    Hi,

     

    Is it Reuch - U3 or Reuch*U3 ?

    If it is a multiplication, then:

    subject to {
            forall(h in home, t in time : t >= Ta[h] && t <= Td[h])
               Peuch[h,t] <= Reuch[h,t]*U3[h,t];
    }
    

    But this won't work with CPLEX which will complain that the problem is not convex.

    So using CP you need to use integer variables (you can increase their range to have many values). The problem will look like:

    using CP;
    
    int H = 3;
    int T = 3;
    
    range home = 1..H;
    range time = 1..T;
    
    int Ta[home] = [1,2,3];
    int Td[home] = [4,5,6];
    
    dvar int Peuch[home,time];
    dvar int Reuch[home,time];
    dvar boolean U3[home,time];
    
    // what is the objective?
    subject to {
            forall(h in home, t in time : t >= Ta[h] && t <= Td[h])
               Peuch[h,t] <= Reuch[h,t] * U3[h,t];
    }
    

     


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: constrains problem

    Posted Wed December 16, 2015 10:14 AM

    Originally posted by: EpiphoneTomato


    Thank you so much.this is what I want to know. 


    #CPOptimizer
    #DecisionOptimization