Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Unrelated Parallel Machine Scheduling with sequence dependent setup times

    Posted 03/03/24 09:18 PM

    Hello, I want to change the CPLEX codes for the following sequence-dependent setup time-unrelated parallel machine scheduling problem. What I want to change is to provide manual data entry from the data file. Can anyone help me change the problem coding?

    The .mod file is as follows:

    using CP;

    int nbJobs = 10;
    range Jobs = 0..nbJobs-1;

    int nbMachines = 3;
    range Machines = 0..nbMachines-1;

    // randomly generate processing time for each job
    int minProcessingTime=10;
    int maxProcessingTime=40;
    int processingTimes[j in Jobs]=minProcessingTime+rand(maxProcessingTime-minProcessingTime);

    // randomly generate setup times between jobs
    int minSetUpTime=5;
    int maxSetUpTime=10;
    tuple setup { 
    int j1; 
    int j2; 
    int setuptime; }

    {setup} SetUpMatrix[m in Machines] ={ <j1,j2,minSetUpTime+rand(maxSetUpTime-minSetUpTime)> | j1,j2 in Jobs : j1 != j2};

    // introduce decision variables
    dvar interval itvs[j in Jobs][m in Machines] optional size processingTimes[j];
    dvar sequence machine[m in Machines] in all(j in Jobs) itvs[j][m] types all(j in Jobs) j;

    // minimize makespan
    minimize max(j in Jobs,m in Machines) (endOf(itvs[j][m]));

    subject to { 

    //each job should be assigned to a machine
    forall (j in Jobs) 
          sum(m in Machines) (presenceOf(itvs[j][m])) ==1;
          
    //no overlap
    forall (m in Machines) 
        noOverlap(machine[m],SetUpMatrix[m]);   

    execute {
      for (var j in Jobs) {
        for (var m in Machines) {
          if (itvs[j][m].present) {
            writeln("Job " + j + " on machine " + m + " starts at " +  itvs[j][m].start);
            writeln("Job " + j + " on machine " + m + " ends at " +  itvs[j][m].end);
             } 
        }      
      }
    }



    ------------------------------
    Buğra Davut Daşkın
    ------------------------------


  • 2.  RE: Unrelated Parallel Machine Scheduling with sequence dependent setup times

    Posted 03/04/24 08:02 AM

    Hello Buğra Davut Daşkın,
    Within OPL you may execute regular Java Script using IloOplOutputFile / IloOplInputFile to deal with your "manual" data.

    From opl/BasketballScheduling/basketballscheduling.mod example:

    // Create a data file
    execute
    {
      f = new IloOplOutputFile();
       f.open("acc0.dat");
       f.writeln("patset=");
       f.writeln(thisOplModel.patset);
       f.writeln(";");
       f.close();
    }

    Hope this helps



    ------------------------------
    Cédric Doens
    ------------------------------