File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def compile_solution(data, perm):
4949 job = perm [i ]
5050 mach_times [0 ].append (mach_times [0 ][- 1 ] + data [perm [i - 1 ]][0 ])
5151 for mach in range (1 , nmach ):
52- mach_times [mach ].append (max (mach_times [mach - 1 ][i ] + data [i ][mach - 1 ],
52+ mach_times [mach ].append (max (mach_times [mach - 1 ][i ] + data [perm [ i ] ][mach - 1 ],
5353 mach_times [mach ][i - 1 ] + data [perm [i - 1 ]][mach ]))
5454
5555 return mach_times
@@ -86,7 +86,7 @@ def print_solution(data, perm):
8686 row_format = "{:>15}" * 4
8787 print row_format .format ('Machine' , 'Start Time' , 'Finish Time' , 'Idle Time' )
8888 for mach in range (len (data [0 ])):
89- finish_time = sol [mach ][- 1 ] + data [perm [- 1 ]][- 1 ]
89+ finish_time = sol [mach ][- 1 ] + data [perm [- 1 ]][mach ]
9090 idle_time = (finish_time - sol [mach ][0 ]) - sum ([job [mach ] for job in data ])
9191 print row_format .format (mach + 1 , sol [mach ][0 ], finish_time , idle_time )
9292
You can’t perform that action at this time.
0 commit comments