packing_options = get_packing_options(min_w, max_w, min_l, max_l, rect_list, step_size = 1, \
result_list = []
for opt in packing_options:
step_w = float(get_max(opt.sheets))
tmp_sheets = trim_sheets(opt.sheets, max(min_w,step_w), min_l)
tmp_l = float(get_max(tmp_sheets,False))
tmp_result_list = []
tmp_w = step_w
while area/tmp_w >= tmp_l:
tmp_sheet = Sheet(tmp_w, area/tmp_w)
tmp_result_list.append(find_best_packing_GA(tmp_sheet, sheets_to_rect_list(tmp_sheets), \
Pm = 0, rotate_prob = 0, flex = True, only_vertical = True))
tmp_w = tmp_w + step_w
result_list.append(best_individual(tmp_result_list)[0])
best, avg_fit, best_index = best_individual(result_list)
fig = packing_options[best_index].plot_sheets()
dataPlot = FigureCanvasTkAgg(fig, master = window)
dataPlot.draw()
dataPlot.get_tk_widget().pack(side='top', fill='both', expand=1)
fig1 = best.plot_sheets()
dataPlot1 = FigureCanvasTkAgg(fig1, master = window)
dataPlot1.draw()
dataPlot1.get_tk_widget().pack(side='top', fill='both', expand=1)
这是输出的图片:https://imgur.com/NZaZkwa