1 defFormatsolution (S, C, I):2T = [0 forJinchxrange (I.N)]3S = [[0 forTinchI[J]] forJinchxrange (I.N)]4 forIinchXrange (Len (s)): "" "Traverse chromosome" ""5j =S[i] "" To obtain the workpiece number of I J " " "6t =T[j] "" "Obtained I is the first step of J T" ""7S[J][T] =C[i] "" "Save the processing time of I to the corresponding position in S " "8T[J] = T[j] + 1 "" Workpiece J Process Accumulator +1 "" "9 returnS
s stores the time at which each process begins processing, in the form of: [[[A,b,c],[d,e,f],[g,h,i]], each sub-list represents the information of an artifact, and the letters in the sub list represent the time at which each operation of the workpiece begins to be processed.
Assuming we know how long each process begins to process, and we know the number of machines required for each process, we can get the processing order of the processes on each machine, and then use the software to draw a Gantt chart of the schedule.
Study on the application of genetic algorithm in Jobshop (Part 6: Result display)