From 1028dfed30ed60c634cee34c00bffe5c79e70e22 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Tue, 20 Apr 2021 21:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .idea/scheduling.iml | 2 +- dataset_importer.py | 2 +- scheduling.py | 13 +++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 0816e31..30078b5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/.idea/scheduling.iml b/.idea/scheduling.iml index dde2ab6..74d515a 100644 --- a/.idea/scheduling.iml +++ b/.idea/scheduling.iml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/dataset_importer.py b/dataset_importer.py index 7d2e1ac..c95ad72 100644 --- a/dataset_importer.py +++ b/dataset_importer.py @@ -51,7 +51,7 @@ def import_process(res, products: Dict[str, model.Product]) -> Dict[str, model.P for record in res: process: model.Process = model.Process(record[0], record[1], products[record[2]], record[9]) - process.set_mode_quantity(record[5], record[6], record[7]) + process.set_mode_quantity(record[5], record[7], record[6]) process.set_product_time(record[8]) products[record[2]].add_process(process) processes[process.pcs_id] = process diff --git a/scheduling.py b/scheduling.py index 6b032a5..05ecc4d 100644 --- a/scheduling.py +++ b/scheduling.py @@ -38,15 +38,16 @@ def search_semi_products(floor, produce_tree, produce_list, runtime_product): produce_tree.append({"runtime_product": runtime_product, "runtime_semi_products": runtime_semi_products}) # print("F", runtime_product.product.product_id, runtime_product.ddl) if len(runtime_product.product.semi_products) > 0: + for i in range(runtime_product.amount): + for item in runtime_product.product.semi_products: - for item in runtime_product.product.semi_products: + runtime_semi_product = runtime.RuntimeProduct(item["semi_product"], item["amount"]) + runtime_semi_product.set_ddl_start(runtime_product.ddl, runtime_product.start) - runtime_semi_product = runtime.RuntimeProduct(item["semi_product"], item["amount"]) - runtime_semi_product.set_ddl_start(runtime_product.ddl, runtime_product.start) + # print("C", runtime_semi_product.product.product_id, runtime_semi_product.ddl) - # print("C", runtime_semi_product.product.product_id, runtime_semi_product.ddl) - - search_semi_products(floor+1, runtime_semi_products, produce_list, runtime_semi_product) + for k in range(runtime_semi_product.amount): + search_semi_products(floor+1, runtime_semi_products, produce_list, runtime_semi_product) print("L", floor, runtime_product.product.product_id, runtime_product.ddl) produce_list.append(runtime_product)