From 837af37e9afe38634e9577cd5c49521472f40cba Mon Sep 17 00:00:00 2001 From: jackfiled Date: Sat, 4 Jun 2022 16:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86=E5=90=88=E6=88=90?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=96=87=E4=BB=B6=E7=9A=84=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=BA=86=E6=B5=8B=E8=AF=95=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=BC=BA=E5=B0=91=E7=BC=BA=E7=9C=81=E5=80=BC=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- all_test/src/tools.c | 17 +++++++++++++---- main.py | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/all_test/src/tools.c b/all_test/src/tools.c index bb63d27..6a66938 100644 --- a/all_test/src/tools.c +++ b/all_test/src/tools.c @@ -174,12 +174,21 @@ rail_node_t *ReadChosenConfigFile(char *config_file_path) } - if (distance != 0 && total_station != 0) + // 处理参数去缺省值的情况 + if (distance == 0) { - return CreateRails(distance, total_station); + distance = 2; } - else + if (total_station == 0) { - return NULL; + total_station = 5; } + if(chosen_strategy == -1) + { + chosen_strategy = BUS_FCFS; + } + + all_distance = distance * total_station; + rail_node_t *head = CreateRails(distance, total_station); + return head; } \ No newline at end of file diff --git a/main.py b/main.py index 0c9a6f5..97d60bf 100644 --- a/main.py +++ b/main.py @@ -26,7 +26,7 @@ input_file.write( # 读取include, src两个文件夹 # include文件的顺序需要手动指定 -include_list: list = ["rail.h", "bus.h", "query.h", "bus_io.h", "controller.h", "define.h"] +include_list: list = ["rail.h", "query.h", "bus.h", "bus_io.h", "controller.h", "define.h"] src_list: list = os.listdir(src_path) for file_name in include_list: