Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX syntax support

    Posted 01/30/16 12:42 AM

    Originally posted by: NguyenHuuTRi


    Hello,

    I am modelling the timetabling model. In my model, I have 173 groups of class of student. Each group will require students to study some required courses and so it is required that each course belong to that group can not be overlapped. I am trying to input the syntax. However, I wonder if we have any way to input the below syntax for all groups once a time instead that we have to input 173 times.

     

    Thank you very much.

     

    Regards,

     

    Nguyen Huu Tri. 

     

    intgroup12[course]=...;

    intgroup16[course]=...;

    tuplecoursegroup {

          int idcourse;

           

    };

    setof(coursegroup) G12 = {<c> | c in course: group12[c]==1};

    setof(coursegroup) G16= {<c> | c in course: group16[c]==1};

     

    forall(t in timeslot) {

                asigngroup12: sum(<l,c,ty,t> in LectureCourseTimes : <c> in G12) x[<l,c,ty,t>] <=1 ;

          };

     

    forall(t in timeslot) {

                asigngroup16: sum(<l,c,ty,t> in LectureCourseTimes : <c> in G16) x[<l,c,ty,t>] <=1 ;


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: CPLEX syntax support

    Posted 01/30/16 04:24 AM

    Hi,

    you could use arrays of sets.

    Let me show you the syntax through an example and you ll manage from there:

    range R=1..100;
     range course=1..10;
     range timeslot=1..10;
     
     int group[r in R][c in course];
     
      tuple coursegroup {

          int idcourse;

           

    };

    setof(coursegroup) G[r in R] = {<c> | c in course: group[r][c]==1};

    dvar int x[course];

    subject to
    {
     
    forall(r in R)
    forall(t in timeslot) {

                asigngroup12: sum(c in course : <c> in G[r]) x[c] <=1 ;

          };

     

    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer