Problem in Calculate Makespan (P||Cmax)

44 views
Skip to first unread message

Izzati Moy

unread,
Mar 7, 2016, 1:33:22 PM3/7/16
to ai...@googlegroups.com
Hello, I'm new at Aimms and I'm having a problem in solving the identical parallel machine. Anyone can help me in how to enter data in processing time? 

Develop the minimum makespan , assuming 2 processors are to be used in parallel.

Tasks

1

2

3







Processing Times

8

7

5








The coding that I have done.  
 
Model Main_Makespan {
    Parameter MaxTasks {
        Text: "Number of elements in the set Tasks";
        Range: integer;
    }
    Set Tasks {
        Text: "Set of all Tasks";
        Index: i;
        Definition: ElementRange(1,MaxTasks, prefix: "Task-");
    }
    Parameter MaxProcessors {
        Text: "Number of elements in the set Processors";
        Range: integer;
    }
    Set Processors {
        Text: "Set of all processors";
        Index: j;
        Definition: ElementRange(1,MaxProcessors, prefix: "M-");
    }
    Parameter ProcessingTime {
        IndexDomain: j;
        Text: "Time required to process task i on processor j";
    }
    Variable X {
        IndexDomain: (i,j);
        Range: binary;
    }
    Variable Makespan {
        Text: "Total time to process all tasks on all processors";
        Range: free;
        Definition: sum(j,ProcessingTime(j));
    }
    Constraint Constraint1 {
        IndexDomain: j;
        Definition: sum(i,X(i,j)*ProcessingTime(j)) <= Makespan;
    }
    Constraint Constraint2 {
        IndexDomain: i;
        Definition: sum(j,X(i,j)) = 1;
    }
    Constraint Constraint3 {
        Definition: Makespan >= 0;
    }
    MathematicalProgram MinimizeMakespan {
        Objective: Makespan;
        Direction: minimize;
        Constraints: AllConstraints;
        Variables: AllVariables;
        Type: Automatic;
    }
    Procedure MainInitialization {
        Body: {
            MaxTasks := 3;
            MaxProcessors := 2;
        }
    }
    Procedure MainExecution {
        Body: {
            solve MinimizeMakespan;
            if (MinimizeMakespan.ProgramStatus<> 'Optimal')
            then empty X(i,j), Makespan;
            endif;
        }
    }
    Procedure MainTermination {
        Body: {
            return DataManagementExit();
        }
    }
}

Marcel Hunting

unread,
Mar 8, 2016, 9:10:20 AM3/8/16
to AIMMS - The Modeling System
Hi,

Your table indicates that the processing times depend on the Tasks (and not the Processors). Therefore the ProcessingTime should have index domain 'i', the index of the set Tasks. The data can then be assigned using for example

ProcessingTime := data { Task-1 : 8,  Task-2 : 7, Task-3 : 5 } ;

Best regards,

Marcel Hunting
AIMMS Optimization Specialist

Izzati Moy

unread,
Mar 16, 2016, 5:58:59 AM3/16/16
to ai...@googlegroups.com
Thanks for your help but I don't understand "ProcessingTime should have index domain 'i', the index of the set Tasks", and what should I coding this formula Makespan= completion of ProcessingTime (maximum), 

sum(j,ProcessingTime(j)); Is it wrong?

On 8 March 2016 at 22:10, Marcel Hunting <Marcel....@aimms.com> wrote:
Boxbe This message is eligible for Automatic Cleanup! (Marcel....@aimms.com) Add cleanup rule | More info

Hi,

Your table indicates that the processing times depend on the Tasks (and not the Processors). Therefore the ProcessingTime should have index domain 'i', the index of the set Tasks. The data can then be assigned using for example

ProcessingTime := data { Task-1 : 8,  Task-2 : 7, Task-3 : 5 } ;

Best regards,

Marcel Hunting
AIMMS Optimization Specialist

On Monday, March 7, 2016 at 7:33:22 PM UTC+1, Izzati Moy wrote:

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages