Largest Candidate Rule

I have to write a program for assembly line balancing utilizing the Largest Candidate rule. Basically that is taking a series of elements with an associated time, then reordering the elements in descending order by time, ie the longest time first. Then I must group the elements into work stations by observing other constraints. Any suggestions. I am still pretty new to Matlab so my knowledge is still pretty basic.
I am having a hard time visualizing how to group the elements into work stations. There is a time cycle which the sum of the time of the grouped elements cannot exceed. There are also precedence factors which dictate which station certain elements can be in. I just cannot figure out how to account for all of it. It seems to me there would be an overwhelming amount of "if" statements in this code.

 Accepted Answer

UJJWAL
UJJWAL on 27 Sep 2011
Hi Jason,
Ok. I am assuming some things. I assume that you are a very basic and new user of MATLAB. So The code which I am giving is an extremely basic code just to give you a feel of the steps. There can be more optimized and complicated and slick codes but I have made this basic code for you for your understanding.
a(:,1) = randi(1000,[1,100]); % Suppose it denotes the time taken
a(:,2) = randi(5000,[1,100]); % Suppose it denotes constraint A
a(:,3)= randi(20000,[1,100]); % Suppose it denotes constraint B
[p,q] = sort(a(:,1),'descend'); % Please look the syntax up in the help file
a(:,[1:end]) = a(q,[1:end]); % What I have done is that I have just arranged the observations in the order of their decreasing time
work1 = []; % Suppose I have 3 workstations and I have declared three vectors to store the elements to work on them
work2=[];
work3=[];
for i = 1: size(a,1)
if a(i,2)+a(i,3)>2000; % IF the sum of constraints A and B is more than 2000 then work at workstation 1
work1= horzcat(work1,a(i,1));
else
if a(i,2)+a(i,3)<2000 && a(i,2)+a(i,3)>1000 % Similarly the two conditions
work2 = horzcat(work2,a(i,1));
else
work3=horzcat(work3,a(i,1));
end
end
end
Of Course the number of if statements involved would be large depending upon the constraints and their inter-relationships. In Pattern Recognition also we work on large number of constraints and in many cases it is impossible to escape the if-else statements. Dont be afraid of them. In some cases you may reduce the number of if-else statements but it takes luck and conditions. I hope this code would give you an idea of the problem. I hope I have captured ur problem and given u an apt reply. If you need more help, mail back
Happy to Help
UJJWAL

3 Comments

Jason
Jason on 27 Sep 2011
Okay, I think I follow enough to understand what the code is doing. I'll add a little more detail into what I need to accomplish just to give you a better idea of what I am trying to do.
I have to input 5 conditions, element number, element description(text), element time, immediate predecessors (as referenced above and this means element 5 cannot be completed without first doing element 1 and 2 as an example, and there can be as many as 5 predecessors), and negative zoning. I have not decided if I want this to be a data file, keyed in by the user or a simple data statement in the program itself. I think the later would probably be the easiest.
As I said before I have to reorder the elements, then group the elements into work stations which is what you have shown above. These work stations are restricted by a time cycle which is dictated by the sum of all the elements time. There are some basic calculations to determine the actual cycle but you get the idea. The station groupings my be elements 1,2,3 and 4 or it could be 5, 2, 1 and 4. I cant have element 14 in the first station because you have to perform several other elements before that.
My output has to be 1. a list of the elements with the text description for each element per station 2. the station's working and delay times 3. average percent delay time and 4. standard deviation. Parts 2, 3 and 4 I am pretty sure I can handle. Part 1 is tripping me up. I have to input a text associated with an element and then print that text still associated with the element within the constraints of the work station.
What you have provided is a very nice starting point and I thank you. I hope my addition here is not confusing. If it is, I will do my best to clarify it. Thank you for taking the time to help. Matlab is a wonderful tool and I find more uses for it each time I use it but it is still a lot to take in when you are still a novice.
Jason
Jason on 27 Sep 2011
I forgot to add it only needs to be able to handle 40 elements. So I was thinking it would be in the area of a 40 by 9 matrix, as in
[ element# elementdescription elementtime predecessors1 2 3 4 5 negativezoning]
How should i Implement largest candiadte rule for simple data.

Sign in to comment.

More Answers (0)

Categories

Asked:

on 27 Sep 2011

Commented:

on 9 Dec 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!