From 58bc9029043f6672d9febac24f92c208afc895b6 Mon Sep 17 00:00:00 2001 From: govin08 Date: Fri, 8 Mar 2024 17:03:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A2=8C=ED=9A=8C=EC=A0=84=EC=8B=9C=EB=A5=BC?= =?UTF-8?q?=20=EB=B3=B4=ED=96=89=EC=8B=A0=ED=98=B8=EB=B3=B4=EB=8B=A4=20?= =?UTF-8?q?=EC=9A=B0=EC=84=A0=ED=95=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0307_red_yellow/0307_red_yellow_2.ipynb | 591 ++++++++++++++- .../0308_유턴신호배정.md | 60 ++ Results/sn_1704417000.add.xml | 681 ++++++++---------- Results/sn_1704417300.add.xml | 669 +++++++++++++++++ .../generate_signals.cpython-38.pyc | Bin 25385 -> 25385 bytes .../preprocess_daily.cpython-38.pyc | Bin 31189 -> 31540 bytes Scripts/preprocess_daily.py | 20 +- 7 files changed, 1644 insertions(+), 377 deletions(-) create mode 100644 Analysis/0307_red_yellow/0308_유턴신호배정.md create mode 100644 Results/sn_1704417300.add.xml diff --git a/Analysis/0307_red_yellow/0307_red_yellow_2.ipynb b/Analysis/0307_red_yellow/0307_red_yellow_2.ipynb index 6fef53404..33ae331fd 100644 --- a/Analysis/0307_red_yellow/0307_red_yellow_2.ipynb +++ b/Analysis/0307_red_yellow/0307_red_yellow_2.ipynb @@ -7108,10 +7108,595 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1. 데이터를 준비합니다.\n", + "1-1. 네트워크가 로드되었습니다.\n", + "1-2. 테이블들이 로드되었습니다.\n", + "2. 신호이력 테이블을 변환합니다.\n", + "3. 이동류정보 테이블을 변환합니다.\n", + "4. 통합 테이블을 생성합니다.\n", + "5. 신호를 생성합니다.\n", + "6. 이슈사항을 저장합니다.\n", + "(1) 0:00:00.062696\n", + "(1-1) 0:00:00.011912\n", + "(1-2) 0:00:00.027038\n", + "(1-3) 0:00:00\n", + "(1-4) 0:00:00\n", + "(1-5) 0:00:00.023746\n", + "(2) 0:00:00.517846\n", + "(2-1) 0:00:00.083063\n", + "(2-2) 0:00:00.403649\n", + "(2-3) 0:00:00.031134\n", + "(3) 0:00:00.354969\n", + "(3-1) 0:00:00.327645\n", + "(3-2) 0:00:00.027324\n", + "(4) 0:00:00.209483\n", + "(4-1) 0:00:00.001956\n", + "(4-2) 0:00:00.015003\n", + "(4-2) 0:00:00.192524\n", + "(5) 0:00:00.814094\n", + "(5-1) 0:00:00.012088\n", + "(5-2) 0:00:00.795342\n", + "(5-3) 0:00:00.006664\n", + "(6) 0:00:00.000875\n", + "total time : 0:00:01.959963\n" + ] + } + ], + "source": [ + "self = SignalGenerator()\n", + "self.main()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
inter_nonode_idstart_unixphas_Aphas_Bmove_Amove_Bdurationstate_Astate_Bphase_sumo
0178c301704416690118438rrrrrrrrrrrr0
1178c301704416690227339GGGrrrrrrGGG1
2178c301704416690335243GGGrrrrrrGGG2
3178c301704416690446122GGGrrrrrrGGG3
4178c301704416860118438rrrrrrrrrrrr0
....................................
233210u6017044171401161828ggggggggrggggggggr0
234210u601704417140126215ggggggggrggggggggr1
235210u601704417140225243ggggggggGggggggggr2
236210u601704417140337470ggggggggrggggggggr3
237210u601704417140448324ggggggggrggggggggr4
\n", + "

238 rows × 11 columns

\n", + "
" + ], + "text/plain": [ + " inter_no node_id start_unix phas_A phas_B move_A move_B duration \\\n", + "0 178 c30 1704416690 1 1 8 4 38 \n", + "1 178 c30 1704416690 2 2 7 3 39 \n", + "2 178 c30 1704416690 3 3 5 2 43 \n", + "3 178 c30 1704416690 4 4 6 1 22 \n", + "4 178 c30 1704416860 1 1 8 4 38 \n", + ".. ... ... ... ... ... ... ... ... \n", + "233 210 u60 1704417140 1 1 6 18 28 \n", + "234 210 u60 1704417140 1 2 6 2 15 \n", + "235 210 u60 1704417140 2 2 5 2 43 \n", + "236 210 u60 1704417140 3 3 7 4 70 \n", + "237 210 u60 1704417140 4 4 8 3 24 \n", + "\n", + " state_A state_B phase_sumo \n", + "0 rrrrrr rrrrrr 0 \n", + "1 GGGrrr rrrGGG 1 \n", + "2 GGGrrr rrrGGG 2 \n", + "3 GGGrrr rrrGGG 3 \n", + "4 rrrrrr rrrrrr 0 \n", + ".. ... ... ... \n", + "233 ggggggggr ggggggggr 0 \n", + "234 ggggggggr ggggggggr 1 \n", + "235 ggggggggG ggggggggr 2 \n", + "236 ggggggggr ggggggggr 3 \n", + "237 ggggggggr ggggggggr 4 \n", + "\n", + "[238 rows x 11 columns]" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "self.sigtable" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
node_idstart_unixphasedurationstate
0c3017044166901g_1g34rrrrrr
1c3017044166901y_1y4rrrrrr
2c3017044166902r_2r2rrrrrr
3c3017044166902g_2g33GGGGGG
4c3017044166902y_2y4GGGGGG
..................
51u6017044171402r_2g2ggggggggr
52u6017044171402g_2g37ggggggggG
53u6017044171402y_2y4ggggggggy
54u6017044171403r_3r2ggggggggr
55u6017044171403g_3g64ggggggggr
\n", + "

637 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " node_id start_unix phase duration state\n", + "0 c30 1704416690 1g_1g 34 rrrrrr\n", + "1 c30 1704416690 1y_1y 4 rrrrrr\n", + "2 c30 1704416690 2r_2r 2 rrrrrr\n", + "3 c30 1704416690 2g_2g 33 GGGGGG\n", + "4 c30 1704416690 2y_2y 4 GGGGGG\n", + ".. ... ... ... ... ...\n", + "51 u60 1704417140 2r_2g 2 ggggggggr\n", + "52 u60 1704417140 2g_2g 37 ggggggggG\n", + "53 u60 1704417140 2y_2y 4 ggggggggy\n", + "54 u60 1704417140 3r_3r 2 ggggggggr\n", + "55 u60 1704417140 3g_3g 64 ggggggggr\n", + "\n", + "[637 rows x 5 columns]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "self.SIGTABLE" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
node_idstart_unixphasedurationstate
0c3017044166901g_1g34rrrrrr
1c3017044166901y_1y4rrrrrr
2c3017044166902r_2r2rrrrrr
3c3017044166902g_2g33GGGGGG
4c3017044166902y_2y4GGGGGG
..................
51u6017044171402r_2g2ggggggggr
52u6017044171402g_2g37ggggggggG
53u6017044171402y_2y4ggggggggy
54u6017044171403r_3r2ggggggggr
55u6017044171403g_3g64ggggggggr
\n", + "

637 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " node_id start_unix phase duration state\n", + "0 c30 1704416690 1g_1g 34 rrrrrr\n", + "1 c30 1704416690 1y_1y 4 rrrrrr\n", + "2 c30 1704416690 2r_2r 2 rrrrrr\n", + "3 c30 1704416690 2g_2g 33 GGGGGG\n", + "4 c30 1704416690 2y_2y 4 GGGGGG\n", + ".. ... ... ... ... ...\n", + "51 u60 1704417140 2r_2g 2 ggggggggr\n", + "52 u60 1704417140 2g_2g 37 ggggggggG\n", + "53 u60 1704417140 2y_2y 4 ggggggggy\n", + "54 u60 1704417140 3r_3r 2 ggggggggr\n", + "55 u60 1704417140 3g_3g 64 ggggggggr\n", + "\n", + "[637 rows x 5 columns]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "self.SIGTABLE" + ] }, { "cell_type": "code", diff --git a/Analysis/0307_red_yellow/0308_유턴신호배정.md b/Analysis/0307_red_yellow/0308_유턴신호배정.md new file mode 100644 index 000000000..4d536d404 --- /dev/null +++ b/Analysis/0307_red_yellow/0308_유턴신호배정.md @@ -0,0 +1,60 @@ +# 유턴신호 부여 로직 +## 입력 1. `self.match5` +- 컬럼목록 : 노드id, 현시번호, 링타입, 이동류번호, 진입/진출방향, 진입/진출엣지id +- 설명 : 부모교차로에 대한 매칭정보 +![match5](https://i.imgur.com/ggy3AqY.png) + +## 입력 2. `self.uturn` +- 컬럼목록 : 부모노드id, 자식노드id, 진입방향, 조건, 진입/진출방향 +- 설명 : 유턴에 대한 정보 +- 여기에서 조건이란 "좌회전시" 또는 "보행신호시" 또는 ""(지정되지 않음) 중 하나임. +![uturn](https://i.imgur.com/kUe9etr.png) + +## 출력 : `self.match6` +- 컬럼목록 : `self.match5와` 같음 +- 설명 : 부모 및 자식교차로에 대한 매칭정보 (자식교차로 : 유턴교차로, 연등교차로) +![match6](https://i.imgur.com/jOtBkNx.png) + +## 유턴신호 부여 알고리즘 + +## 요약 : +각 유턴노드별로 `self.match5`에서 해당되는 행들을 가져오고 (이것을 `cmatch`라고 한다.) +조건별로 `cmatch`에서 해당되는 행에 진입/진출엣지id를 지정한다. + +## 상세: +각 유턴 노드에 대하여 `cmatch`를 다음과 같이 정한다. + +- (1) `cmatch` + - (1-1) 부모노드의 `self.match5`에 해당하는 데이터프레임(`cmatch`)을 가져온다. + - (1-2) `node_id`는 자식노드id로 부여하고, 진입/진출엣지id는 `np.nan`으로 초기화한다. +- (2) 조건이 "좌회전시", "보행신호시"이면 + - (2-1) 그에 따라 진입/진출방향을 정한다. (8방위) + - (2-2) `cmatch`에서 진입/진출방향에 대응되는 행에 진입/진출엣지id를 지정한다. +- (3) 조건이 지정되지 않았거나, + 조건이 지정되었어도 진입/진출방향에 대응되는 행이 존재하지 않으면 + 좌회전시 → 보행신호시 → 보행신호이동류발생시 → 신호없음이동류발생시 순으로 유턴신호를 정한다. + - (3-1) 좌회전시 + + 3-1에 해당하지 않고 + 좌회전에 대응되는 진입/진출방향에 대한 행이 `cmatch`에 존재하면 + 해당 행에 진입/진출엣지id를 지정한다. + - (3-2) 보행신호시 + + 보행신호에 대응되는 진입/진출방향에 대한 행이 `cmatch`에 존재하면 + 해당 행에 진입/진출엣지id를 지정한다. + - (3-3) 보행신호이동류발생시 + + 3-1, 3-2에 해당하지 않고, 이동류번호가 17(보행신호이동류)인 행이 `cmatch`에 존재하며 + 유턴노드 방향으로 진출하는 신호가 없으면 + 해당 행에 진입/진출엣지id를 지정한다. + - (3-4) 신호없음이동류발생시 + + 3-1, 3-2, 3-3에 해당하지 않고, 이동류번호가 18(신호없음)인 행이 `cmatch`에 존재하며 + 유턴노드 방향으로 진출하는 신호가 없으면 + 해당 행에 진입/진출엣지id를 지정한다. + - (3-5) 3-1 ~ 3-4에 해당되지 않는다면 유턴신호를 g로 지정한다. + +## 이후과정: +각 유턴노드에 대한 `cmatch`들을 리스트 형태로 저장한 후 `pd.concat`하여 합친다 (`cmatches`). +연동교차로에 대해서도 비슷한 종류의 테이블을 만들어둔다. (`self.coord`, 상세 생성과정 생략) +`self.match5`, `cmatches`, `self.coord를` `pd.concat`하여 `self.match6`를 만든다. \ No newline at end of file diff --git a/Results/sn_1704417000.add.xml b/Results/sn_1704417000.add.xml index 516cc7008..673f689fb 100644 --- a/Results/sn_1704417000.add.xml +++ b/Results/sn_1704417000.add.xml @@ -1,62 +1,59 @@ - - - - + + + + - - + + - - + + + + + + + + - - - - - + + - - + + + + + + + + - - + + - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + - + - + - + @@ -68,10 +65,10 @@ - + - + @@ -83,17 +80,12 @@ - - - - - - - + + - + @@ -124,12 +116,9 @@ - - - - + @@ -172,120 +161,112 @@ - - - - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + - + @@ -328,72 +309,66 @@ - - - - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + @@ -412,12 +387,9 @@ - - - - + @@ -454,263 +426,244 @@ - - - - - - + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + - - - - - + + - - + + - - + + - - + + - - + + - - + + - + + + + - - + + - - + + + + + - - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + \ No newline at end of file diff --git a/Results/sn_1704417300.add.xml b/Results/sn_1704417300.add.xml new file mode 100644 index 000000000..904cdaeee --- /dev/null +++ b/Results/sn_1704417300.add.xml @@ -0,0 +1,669 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Scripts/__pycache__/generate_signals.cpython-38.pyc b/Scripts/__pycache__/generate_signals.cpython-38.pyc index d7e1b054b9a4f6821915b8a01d9dee0247419067..04c2766d17c99505866a0893d27230174d5d7a1c 100644 GIT binary patch delta 21 bcmZ2^jB({LMy^m^UM>b8=-#=JOFkI@N9G0P delta 21 bcmZ2^jB({LMy^m^UM>b8a7^CFC7%ocM0^EB diff --git a/Scripts/__pycache__/preprocess_daily.cpython-38.pyc b/Scripts/__pycache__/preprocess_daily.cpython-38.pyc index eb35c41462e84c74297dd4d346392d47aeed225b..7b1fdefde370fb6b079ae9084e8c58cb05d5bdde 100644 GIT binary patch delta 1307 zcmY*XZD?Cn7{2elNt)&3HciqbcTK;tt~INHF=ZCFVYaH^e#~hT2LZ|APRx>YNq6r} zyTXYP9sXIT)fd!NVM)O;!SB=$M9_bV2>wuq_}?Fk6%>aei29z}u%`EN-t)fC`#jIN z=bZb)AF%N!sA;d)CD9Y#=;Xh>{=QnB?boRE(3quRtSPuM`#1cH&)vV=u=9R47?#Wt zZhsa+k|x!C+`=Ng*Z_Cc{ag4BZh)($QSK|tG>`FtvYeFaK@0PDv4DjQa(i=_yIN51 z=WZ4%%d4_(;~ws96ohn~2U&mx3-XilVW~1kl(0pa5R@)saGODj7>ktUddSK&%EDaT z>T6PSPfIFIu-$CvGBo$Lqt_?J%Mc&Vpy1ZXkM!~8KJK8)aF}?z2$^2)B!HOE5%Be?x>< zL_l0gB|yVZQ$|BAR?cKuQO{==@+@y;)N0M#QQz+C#ll&$r@vKuELk>xp=g*!#$$oE ztK9s2R?jn|Sg26%j9xX2rQCcuTdidLHM6EyvYtxS%;pTi$TLi)HK<@Fy>CVdK?Izj zDlQ1pYlEOdGgU6aT@VtPEeZ~qY8tWb9BQwp|Jen*@oM&C7{ybkzk>ZZmV2geSe!)^ z+HdBP0ROc+PrPFXhF8wMC6{D;dL)9`;z=mud&LaQqq~%bY0QOE`dj^8oyg516OnAYL=q;1C|I9n_LSI4)Lw zNMtdQeMq6xUaduesBbT>LlRFeCEzc7YU!e!0({sJa{gpHmn&9e1!EUJa-@VbjV~;R y-MT{JT{MjSFD*|h4XF>OmLGRNCKw~aT+k+CB6ZSLi0klyM^+os_S@$K2mB9Vr)BB@ delta 963 zcmZ`$Ur19?7(d^=ZqCj9(V6b*oPV1sDyU$B7BiC|NGRO`qqID_wx!GKHq@?+Qliiz z`$8mr*rc9{qNde@&*f`aLOt~oq|T=#ND4aVW{^<#@csCm@B4ng@1AoOzrp*jU~(Ic zdcwXsd84=H!822^#hl5u=`31U3~dNF)$$$M@cPk_sDbVa2zNlfr|8ElibgTh>>Ltu zD4KD|CK4IT7^qbYG)L`u{g3*t#{}w1w(q#BD7e|=xOppsTSAT@6wqcx*1c zKFr@KxiGbLe<~T9NKVenpIIVoX0Vx9+?u(WoQ!SFzG8*-43=BBGLYA>wWCUGE3d%O zj%CX>Pl>=l!(k2G?kdQ{arcl_=NsthqCUB|Qx^<}REAeQ5_I64r@|p*gAH_G67`^m z6v$?n1zDmK^nz1xBz}5+q=AS#-7i6h&(E)bgjX(HOSQ8h>zO2x(&Ga7l4zw*G;jj9 zeUG6X<9;9WHUv7sjeP+(RN`{rwziu8)?J*IZFuq03b+zA{WBuW;mYMhro*h(Q4aDf zKSU*32T!FQ;q5Je({*{Ugf|Ag2GzjI(+#*Y*Z_@KCr7kgD!cHhTm-X;xAH2$JA4>= z19jLRu7!^n3wOgogvfnp!ud$O)Xe*f_?+XM6?3-4U^THBu>)(>4KF}5J{qoqPxxVY zf}P>qNWQQs;Mm9ugPUtSss*03S@j}Qrm+~R#xtW%2;#)(S;J{wcW`45CP$rxc1CsV TiupBLAYCv;$)6R}ffjxN@FWI# diff --git a/Scripts/preprocess_daily.py b/Scripts/preprocess_daily.py index 22d360e02..a25478b64 100644 --- a/Scripts/preprocess_daily.py +++ b/Scripts/preprocess_daily.py @@ -478,21 +478,21 @@ class DailyPreprocessor(): crosswalk_on = cmatch.move_no == 17 # 만약 어떤 유턴신호도 배정되지 않았다면 - # 신호없음이동류발생시 → 보행신호이동류발생시 → 보행신호시 → 좌회전시 순으로 진입/진출 엣지id 배정 + # 좌회전시 → 보행신호시 → 보행신호이동류발생시 → 신호없음이동류발생시 순으로 진입/진출 엣지id 배정 uturn_not_assigned = cmatch[['inc_edge','out_edge']].isna().any(axis=1).all() if uturn_not_assigned: - # 신호없음이동류(18) 발생시 - if all_redsigns.any(): - cmatch.loc[all_redsigns, ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] - # 보행신호이동류(17) 발생시 - elif crosswalk_on.any(): - cmatch.loc[crosswalk_on & (cmatch.out_dir!=direction), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] + # 좌회전시 + if right_exists.any(): + cmatch.loc[right_exists, ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] # 보행신호시 elif pedes_exists.any(): cmatch.loc[pedes_exists, ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] - # 좌회전시 - elif right_exists.any(): - cmatch.loc[right_exists, ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] + # 보행신호이동류(17) 발생시 + elif crosswalk_on.any(): + cmatch.loc[crosswalk_on & (cmatch.out_dir!=direction), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] + # 신호없음이동류(18) 발생시 + elif all_redsigns.any(): + cmatch.loc[all_redsigns & (cmatch.out_dir!=direction), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] cmatches.append(cmatch) # 각 연등교차로(coordination node)에 대하여 (inc_edge_id, out_edge_id) 부여