Browse Source

last modification

master
김선중 1 year ago
parent
commit
a1eb800917
10 changed files with 3703 additions and 4574 deletions
  1. +391
    -0
      Analysis/0411_unp-left_p-right-uturn/0411_match6.ipynb
  2. +0
    -3860
      Analysis/0411_unp-left_p-right-uturn/0411_uturn.ipynb
  3. +368
    -170
      Analysis/0411_unp-left_p-right-uturn/0415_matching.ipynb
  4. +2471
    -0
      Analysis/0411_unp-left_p-right-uturn/0416_initialize_state.ipynb
  5. +64
    -64
      Intermediates/match6.csv
  6. +62
    -62
      Intermediates/matching.csv
  7. +1
    -1
      Intermediates/node2init.json
  8. +307
    -375
      Results/sn_1704417600.add.xml
  9. BIN
      Scripts/__pycache__/preprocess_daily.cpython-38.pyc
  10. +39
    -42
      Scripts/preprocess_daily.py

+ 391
- 0
Analysis/0411_unp-left_p-right-uturn/0411_match6.ipynb View File

@ -0,0 +1,391 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pandas as pd\n",
"import numpy as np\n",
"import sys\n",
"sys.path.append('../../Scripts')\n",
"from preprocess_daily import DailyPreprocessor\n",
"from generate_signals import SignalGenerator"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"비보호좌회전, 신호우회전, 유턴\n",
"\n",
"줄임말 목록\n",
"- `i` : 교차로번호, `inter_no`\n",
"- `f` : 진입, from, `inc_edge_id`\n",
"- `t` : 진출, to, `out_edge_id`\n",
"- `vec` : 방향벡터, unit vector (`np.array([0.6, 0.8])`)\n",
"- `dire` : 방위, direction (동, 서, 남, 북, 북동, 북서, 남동, 남서)\n",
"- `rvec` : 정방향 방향벡터, unit vector to the right direction (`np.array([0,1])`)\n",
"\n",
"필요한 객체들 목록\n",
"\n",
"- `inter2dire2rvec` : `inter_no` $\\mapsto$ `dire2rvec`\n",
" - `dire2rvec` : `dire` $\\mapsto$ `rvec`\n",
"- `inter2incs` : `inter_no` $\\mapsto$ `inc_edge_ids`\n",
"- `inter2outs` : `inter_no` $\\mapsto$ `out_edge_ids`\n",
"- `inter2inc2dire` : `inter_no` $\\mapsto$ `int2dire`\n",
" - `inc2dire` : `out_edge_id` $\\mapsto$ `dire`\n",
"- `inter2out2dire` : `inter_no` $\\mapsto$ `out2dire`\n",
" - `out2dire` : `inc_edge_id` $\\mapsto$ `dire`\n",
"- `inter2inc2vec` : `inter_no` $\\mapsto$ `int2vec`\n",
" - `inc2vec` : `out_edge_id` $\\mapsto$ `vec`\n",
"- `inter2out2vec` : `inter_no` $\\mapsto$ `out2vec`\n",
" - `out2vec` : `inc_edge_id` $\\mapsto$ `vec`\n",
"\n",
"좌회전 판단\n",
"\n",
"Given `inter_no`, `inc_edge_id` and `out_edge_id`, we have `inc_vec = inter2inc2vec[inter_no][inc_edge_id]` and `out_vec = inter2out2vec[inter_no][out_edge_id]`.\n",
"Rotate `inc_vec` by 90, 180 and 270 degrees clockwise, to define \n",
"`out_vec_left`, `out_vec_straight` and `out_vec_right`.\n",
"Define `out_vecs={'right':out_vec_left, 'straight':out_vec_straight, 'right':out_vec_right}`.\n",
"Select the key that maximize the similarity of the corresponding value of the key and `inc_vec`."
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. 데이터를 로드합니다.\n",
"1-1. 네트워크가 로드되었습니다.\n",
"1-2. 테이블들이 로드되었습니다.\n",
"1-3. 네트워크의 모든 clean state requirement들을 체크했습니다.\n",
"1-4. 테이블들의 무결성 검사를 완료했습니다.\n",
"1-5. 주요 객체 (리스트, 딕셔너리)들을 저장했습니다.\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>parent_id</th>\n",
" <th>child_id</th>\n",
" <th>adj_inc_edge_id</th>\n",
" <th>adj_out_edge_id</th>\n",
" <th>inc_edge_id</th>\n",
" <th>out_edge_id</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>i0</td>\n",
" <td>u00</td>\n",
" <td>-571500487_01</td>\n",
" <td>571500487_01</td>\n",
" <td>571500487_02</td>\n",
" <td>571500487_01.32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>i2</td>\n",
" <td>u20</td>\n",
" <td>571542811_02</td>\n",
" <td>571542811_01</td>\n",
" <td>571542810_01.51</td>\n",
" <td>571542810_02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>i3</td>\n",
" <td>u30</td>\n",
" <td>571556450_02</td>\n",
" <td>571556450_01</td>\n",
" <td>571556452_01</td>\n",
" <td>571556452_02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>i3</td>\n",
" <td>u31</td>\n",
" <td>-571500475_01</td>\n",
" <td>571500475_01</td>\n",
" <td>571500475_02</td>\n",
" <td>571500475_01.26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>i3</td>\n",
" <td>u32</td>\n",
" <td>571540303_02.21</td>\n",
" <td>571540303_01</td>\n",
" <td>571540303_02</td>\n",
" <td>-571540303_02</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>i6</td>\n",
" <td>u60</td>\n",
" <td>571500535_02.18</td>\n",
" <td>571500535_01</td>\n",
" <td>571500535_02</td>\n",
" <td>-571500535_02</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" parent_id child_id adj_inc_edge_id adj_out_edge_id inc_edge_id \\\n",
"0 i0 u00 -571500487_01 571500487_01 571500487_02 \n",
"1 i2 u20 571542811_02 571542811_01 571542810_01.51 \n",
"2 i3 u30 571556450_02 571556450_01 571556452_01 \n",
"3 i3 u31 -571500475_01 571500475_01 571500475_02 \n",
"4 i3 u32 571540303_02.21 571540303_01 571540303_02 \n",
"5 i6 u60 571500535_02.18 571500535_01 571500535_02 \n",
"\n",
" out_edge_id \n",
"0 571500487_01.32 \n",
"1 571542810_02 \n",
"2 571556452_02 \n",
"3 571500475_01.26 \n",
"4 -571540303_02 \n",
"5 -571500535_02 "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"self = DailyPreprocessor()\n",
"self.load_data()\n",
"self.make_match1()\n",
"self.make_match2()\n",
"self.make_match3()\n",
"self.make_match4()\n",
"self.make_match5()\n",
"display(self.u_turn)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
"self.u_turn = pd.merge(self.u_turn, self.u_condition, on='child_id')\n",
"\n",
"# p2inc_edge2angle : node_id to inc_edge2angle\n",
"p2inc_edge2angle = dict()\n",
"# p2out_edge2angle : node_id to out_edge2angle\n",
"p2out_edge2angle = dict()\n",
"# p2inc_angle2edge : node_id to inc_angle2edge\n",
"p2inc_angle2edge = dict()\n",
"# p2out_angle2edge : node_id to out_angle2edge\n",
"p2out_angle2edge = dict()\n",
"for node_id in self.parent_ids:\n",
" m5 = self.match5[self.match5.node_id==node_id]\n",
" m5 = m5.dropna(subset=['inc_edge_id', 'out_edge_id'])\n",
" # inc_edge2angle : inc_edge_id to inc_angle\n",
" inc_edge2angle = dict(zip(m5.inc_edge_id, m5.inc_angle.astype(int)))\n",
" p2inc_edge2angle[node_id] = inc_edge2angle\n",
" # out_edge2angle : out_edge_id to out_angle\n",
" out_edge2angle = dict(zip(m5.out_edge_id, m5.out_angle.astype(int)))\n",
" p2out_edge2angle[node_id] = out_edge2angle\n",
" # inc_angle2edge : inc_angle to inc_edge_id\n",
" inc_angle2edge = dict(zip(m5.inc_angle.astype(int), m5.inc_edge_id))\n",
" p2inc_angle2edge[node_id] = inc_angle2edge\n",
" # out_angle2edge : out_angle to out_edge_id\n",
" out_angle2edge = dict(zip(m5.out_angle.astype(int), m5.out_edge_id))\n",
" p2out_angle2edge[node_id] = out_angle2edge\n",
"\n",
"self.uid2uindex = dict() # u_turn node id to u_turn index\n",
"\n",
"# 각 uturn node에 대하여 (inc_edge_id, out_edge_id) 부여\n",
"cmatches = []\n",
"for row in self.u_turn.itertuples():\n",
" parent_id = row.parent_id\n",
" child_id = row.child_id\n",
" condition = row.condition\n",
" inc_edge_id = row.inc_edge_id\n",
" out_edge_id = row.out_edge_id\n",
" adj_inc_edge_id = row.adj_inc_edge_id\n",
" adj_out_edge_id = row.adj_out_edge_id\n",
" \n",
" # self.uid2uindex 지정\n",
" inc_edge = self.net.getEdge(inc_edge_id)\n",
" out_edge = self.net.getEdge(out_edge_id)\n",
" u_turn_conn = inc_edge.getConnections(out_edge)[0]\n",
" self.uid2uindex[child_id] = u_turn_conn.getTLLinkIndex()\n",
" \n",
" # match5에서 부모노드id에 해당하는 행들을 가져옴 (cmatch)\n",
" cmatch = self.match5.copy()[self.match5.node_id==parent_id] # match dataframe for a child node\n",
" cmatch = cmatch.sort_values(by=['phase_no', 'ring_type']).reset_index(drop=True)\n",
" cmatch['node_id'] = child_id\n",
"\n",
" # 진입엣지 각도\n",
" inc_angle = p2inc_edge2angle[parent_id][adj_inc_edge_id]\n",
"\n",
" # 이격각도\n",
" self.angle_separation = 10\n",
"\n",
" # 진입로 각도 목록\n",
" inc_angles = cmatch.dropna(subset=['inc_angle', 'out_angle']).inc_angle.astype(int).unique()\n",
" inc_angles = np.sort(inc_angles)\n",
" inc_angles = list(inc_angles - 360) + list(inc_angles) + list(inc_angles + 360)\n",
" inc_angles = np.array(inc_angles)\n",
"\n",
" # 보행신호시의 진입로 각도\n",
" inc_angles_left = inc_angles[inc_angles >= inc_angle + self.angle_separation]\n",
" inc_angle_pedes = np.sort(inc_angles_left)[0] % 360\n",
"\n",
" # 보행신호시의 진입로 엣지id\n",
" inc_angle2edge = p2inc_angle2edge[parent_id]\n",
" inc_edge_id_pedes = inc_angle2edge[inc_angle_pedes]\n",
"\n",
" # 진출로 각도 목록\n",
" out_angles = cmatch.dropna(subset=['inc_angle', 'out_angle']).out_angle.astype(int).unique()\n",
" out_angles = np.sort(out_angles)\n",
" out_angles = list(out_angles - 360) + list(out_angles) + list(out_angles + 360)\n",
" out_angles = np.array(out_angles)\n",
"\n",
" # 보행신호시의 진입로 각도\n",
" out_angles_right = out_angles[out_angles <= inc_angle - self.angle_separation]\n",
" out_angle_pedes = np.sort(out_angles_right)[-1] % 360\n",
"\n",
" # 보행신호시의 진입로 엣지id\n",
" out_angle2edge = p2out_angle2edge[parent_id]\n",
" out_edge_id_pedes = out_angle2edge[out_angle_pedes]\n",
"\n",
" # 진입엣지/진출엣지 포함 조건\n",
" inc_true = (cmatch.inc_edge_id==adj_inc_edge_id)\n",
" out_true = (cmatch.out_edge_id==adj_out_edge_id)\n",
"\n",
" # 보행신호시 조건\n",
" pedes_flag = (cmatch.inc_edge_id==inc_edge_id_pedes) & (cmatch.out_edge_id==out_edge_id_pedes)\n",
"\n",
" # 좌회전시 조건\n",
" right_flag = inc_true & (cmatch.turn_type=='left')\n",
"\n",
" # 보행신호이동류(17) 조건\n",
" crosswalk_on = (cmatch.move_no==17) & ~ out_true\n",
"\n",
" # 신호없음이동류(18) 조건\n",
" all_redsigns = (cmatch.move_no==18) & ~ out_true\n",
"\n",
" # 보행신호시/좌회전시 진입/진출 엣지id 배정\n",
" cmatch[['inc_edge_id', 'out_edge_id']] = np.nan\n",
" if condition == \"보행신호시\":\n",
" cmatch.loc[pedes_flag, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
" elif condition == \"좌회전시\":\n",
" cmatch.loc[right_flag, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
"\n",
" uturn_not_assigned = cmatch[['inc_edge_id','out_edge_id']].isna().any(axis=1).all()\n",
"\n",
" if uturn_not_assigned:\n",
" # 좌회전시\n",
" if right_flag.any():\n",
" cmatch.loc[right_flag, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
" # 보행신호시\n",
" elif pedes_flag.any():\n",
" cmatch.loc[pedes_flag, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
" # 보행신호이동류(17) 발생시\n",
" elif crosswalk_on.any():\n",
" cmatch.loc[crosswalk_on, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
" # 신호없음이동류(18) 발생시\n",
" elif all_redsigns.any():\n",
" cmatch.loc[all_redsigns, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
" # 진출엣지 미포함시\n",
" elif out_true.any():\n",
" cmatch.loc[~ out_true, ['inc_edge_id', 'out_edge_id']] = [inc_edge_id, out_edge_id]\n",
" cmatches.append(cmatch)\n",
"\n",
"# 각 연등교차로(coordination node)에 대하여 (inc_edge_id, out_edge_id) 부여\n",
"self.coord['inter_no'] = self.coord['parent_id'].map(self.node2inter)\n",
"self.coord = self.coord.rename(columns={'child_id':'node_id'})\n",
"self.coord[['inc_dire', 'out_dire', 'inc_angle','out_angle']] = np.nan\n",
"self.coord['move_no'] = 20\n",
"self.coord = self.coord[['inter_no', 'phase_no', 'ring_type', 'move_no', 'inc_dire', 'out_dire', 'inc_angle','out_angle', 'inc_edge_id', 'out_edge_id', 'node_id']]\n",
"\n",
"cmatches = pd.concat(cmatches)\n",
"self.match6 = pd.concat([self.match5, cmatches, self.coord]).drop_duplicates().sort_values(by=['inter_no', 'node_id', 'phase_no', 'ring_type'])\n",
"self.match6 = self.match6.reset_index(drop=True)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"u00 4\n",
"\n",
"u20 2\n",
"\n",
"u30 4\n",
"\n",
"u31 4\n",
"\n",
"u32 7\n",
"\n",
"u60 8\n",
"\n"
]
}
],
"source": [
"for child_id in self.u_turn_ids:\n",
" print(child_id, self.uid2uindex[child_id])\n",
" print()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "sts",
"language": "python",
"name": "sts"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

+ 0
- 3860
Analysis/0411_unp-left_p-right-uturn/0411_uturn.ipynb
File diff suppressed because it is too large
View File


+ 368
- 170
Analysis/0411_unp-left_p-right-uturn/0415_matching.ipynb View File

@ -296,7 +296,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@ -321,64 +321,70 @@
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>inter_no</th>\n",
" <th>node_id</th>\n",
" <th>move_no</th>\n",
" <th>inc_dire</th>\n",
" <th>out_dire</th>\n",
" <th>inc_edge_id</th>\n",
" <th>out_edge_id</th>\n",
" <th>node_id</th>\n",
" <th>turn_type</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>175</td>\n",
" <td>i0</td>\n",
" <td>1</td>\n",
" <td>동</td>\n",
" <td>남</td>\n",
" <td>571545870_02</td>\n",
" <td>571542797_02</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>175</td>\n",
" <td>i0</td>\n",
" <td>2</td>\n",
" <td>서</td>\n",
" <td>동</td>\n",
" <td>571510153_02</td>\n",
" <td>571545870_01</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>175</td>\n",
" <td>i0</td>\n",
" <td>3</td>\n",
" <td>남</td>\n",
" <td>서</td>\n",
" <td>-571542797_02</td>\n",
" <td>571510153_01</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>175</td>\n",
" <td>i0</td>\n",
" <td>4</td>\n",
" <td>북</td>\n",
" <td>남</td>\n",
" <td>-571500487_01</td>\n",
" <td>571542797_02</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>175</td>\n",
" <td>i0</td>\n",
" <td>5</td>\n",
" <td>서</td>\n",
" <td>북</td>\n",
" <td>571510153_02</td>\n",
" <td>571500487_01</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
@ -389,137 +395,142 @@
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>123</th>\n",
" <td>210</td>\n",
" <td>i6</td>\n",
" <td>12</td>\n",
" <td>북서</td>\n",
" <td>남동</td>\n",
" <td>571500535_02.18</td>\n",
" <td>571542115_01</td>\n",
" <td>i6</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>124</th>\n",
" <td>210</td>\n",
" <td>i6</td>\n",
" <td>13</td>\n",
" <td>남서</td>\n",
" <td>북서</td>\n",
" <td>571500585_02</td>\n",
" <td>571500535_01</td>\n",
" <td>i6</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>125</th>\n",
" <td>210</td>\n",
" <td>i6</td>\n",
" <td>14</td>\n",
" <td>북동</td>\n",
" <td>남서</td>\n",
" <td>571511538_02.121</td>\n",
" <td>571500585_01</td>\n",
" <td>i6</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>126</th>\n",
" <td>210</td>\n",
" <td>i6</td>\n",
" <td>15</td>\n",
" <td>북서</td>\n",
" <td>북동</td>\n",
" <td>571500535_02.18</td>\n",
" <td>571511538_01</td>\n",
" <td>i6</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>127</th>\n",
" <td>210</td>\n",
" <td>i6</td>\n",
" <td>16</td>\n",
" <td>남동</td>\n",
" <td>북서</td>\n",
" <td>-571542115_01</td>\n",
" <td>571500535_01</td>\n",
" <td>i6</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>128 rows × 7 columns</p>\n",
"<p>128 rows × 8 columns</p>\n",
"</div>"
],
"text/plain": [
" inter_no move_no inc_dire out_dire inc_edge_id out_edge_id \\\n",
"0 175 1 동 남 571545870_02 571542797_02 \n",
"1 175 2 서 동 571510153_02 571545870_01 \n",
"2 175 3 남 서 -571542797_02 571510153_01 \n",
"3 175 4 북 남 -571500487_01 571542797_02 \n",
"4 175 5 서 북 571510153_02 571500487_01 \n",
".. ... ... ... ... ... ... \n",
"123 210 12 북서 남동 571500535_02.18 571542115_01 \n",
"124 210 13 남서 북서 571500585_02 571500535_01 \n",
"125 210 14 북동 남서 571511538_02.121 571500585_01 \n",
"126 210 15 북서 북동 571500535_02.18 571511538_01 \n",
"127 210 16 남동 북서 -571542115_01 571500535_01 \n",
" inter_no node_id move_no inc_dire out_dire inc_edge_id \\\n",
"0 175 i0 1 동 남 571545870_02 \n",
"1 175 i0 2 서 동 571510153_02 \n",
"2 175 i0 3 남 서 -571542797_02 \n",
"3 175 i0 4 북 남 -571500487_01 \n",
"4 175 i0 5 서 북 571510153_02 \n",
".. ... ... ... ... ... ... \n",
"123 210 i6 12 북서 남동 571500535_02.18 \n",
"124 210 i6 13 남서 북서 571500585_02 \n",
"125 210 i6 14 북동 남서 571511538_02.121 \n",
"126 210 i6 15 북서 북동 571500535_02.18 \n",
"127 210 i6 16 남동 북서 -571542115_01 \n",
"\n",
" node_id \n",
"0 i0 \n",
"1 i0 \n",
"2 i0 \n",
"3 i0 \n",
"4 i0 \n",
".. ... \n",
"123 i6 \n",
"124 i6 \n",
"125 i6 \n",
"126 i6 \n",
"127 i6 \n",
" out_edge_id turn_type \n",
"0 571542797_02 left \n",
"1 571545870_01 straight \n",
"2 571510153_01 left \n",
"3 571542797_02 straight \n",
"4 571500487_01 left \n",
".. ... ... \n",
"123 571542115_01 straight \n",
"124 571500535_01 left \n",
"125 571500585_01 straight \n",
"126 571511538_01 left \n",
"127 571500535_01 straight \n",
"\n",
"[128 rows x 7 columns]"
"[128 rows x 8 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "display_data"
"output_type": "execute_result"
}
],
"source": [
"self.match7 = self.match6.copy()\n",
"self.match7 = self.match7[['inter_no', 'node_id', 'move_no', 'inc_angle', 'out_angle', 'inc_dire', 'out_dire', 'inc_edge_id', 'out_edge_id']]\n",
"# (1) 가능한 (진입방향, 진출방향) 목록 \n",
"flows = self.nema.dropna().apply(lambda row: (row['inc_dire'], row['out_dire']), axis=1).tolist()\n",
"\n",
"# (2) 각 교차로별 방향 목록 : pdires (possible directions)\n",
"# (1) 각 교차로별 방향 목록 : pdires (possible directions)\n",
"p2dires = {} # parent_id to directions\n",
"for parent_id in self.parent_ids:\n",
" dires = self.match7[self.match7.node_id == parent_id][['inc_dire','out_dire']].values.flatten()\n",
" dires = {dire for dire in dires if type(dire)==str}\n",
" p2dires[parent_id] = dires\n",
"\n",
"# (3) 각 (교차로, 진입방향) 별 진입id 목록 : inc2id (incoming direction to incoming edge_id)\n",
"# (2) 각 (교차로, 진입방향) 별 진입id 목록 : inc2id (incoming direction to incoming edge_id)\n",
"inc2id = {}\n",
"for parent_id in self.parent_ids:\n",
" for inc_dire in p2dires[parent_id]:\n",
" df = self.match7[(self.match7.node_id==parent_id) & (self.match7.inc_dire==inc_dire)]\n",
" inc2id[(parent_id, inc_dire)] = df.inc_edge_id.iloc[0]\n",
"\n",
"# (4) 각 (교차로, 진출방향) 별 진출id 목록 : out2id (outgoing direction to outgoing edge_id)\n",
"# (3) 각 (교차로, 진출방향) 별 진출id 목록 : out2id (outgoing direction to outgoing edge_id)\n",
"out2id = {}\n",
"for parent_id in self.parent_ids:\n",
" for out_dire in p2dires[parent_id]:\n",
" df = self.match7[(self.match7.node_id==parent_id) & (self.match7.out_dire==out_dire)]\n",
" out2id[(parent_id, out_dire)] = df.out_edge_id.iloc[0]\n",
"\n",
"# (5) 각 parent_id별 이동류번호 목록\n",
"# (4) 각 parent_id별 이동류번호 목록\n",
"p2move = dict() # parent id to a list of aligned movement numbers\n",
"for parent_id in self.parent_ids:\n",
" pnema = self.nema[self.nema.inc_dire.isin(p2dires[parent_id]) & self.nema.out_dire.isin(p2dires[parent_id])]\n",
" p2move[parent_id] = list(pnema.move_no)\n",
"\n",
"# (6) 방위별 방향벡터\n",
"# (5) 방위별 방향벡터\n",
"dire2vec = dict() # direction to unit vector\n",
"theta = np.pi/2\n",
"for dire in self.dires:\n",
" dire2vec[dire] = np.array([np.cos(theta), np.sin(theta)])\n",
" theta -= np.pi/4\n",
"\n",
"# (7) 각 parent_id별 : 각 이동류별 진입/진출 엣지 id\n",
"# (6) 각 parent_id별 : 각 이동류별 진입/진출 엣지 id\n",
"p2move2inc_edge_id = dict() # parent id to move2inc_edge_id\n",
"p2move2out_edge_id = dict() # parent id to move2out_edge_id\n",
"for parent_id in self.parent_ids:\n",
@ -561,7 +572,7 @@
" p2move2inc_edge_id[parent_id] = move2inc_edge_id\n",
" p2move2out_edge_id[parent_id] = move2out_edge_id\n",
"\n",
"# (8) 각 이동류별 진입/진출 방위\n",
"# (7) 각 이동류별 진입/진출 방위\n",
"m2inc_dire = dict()\n",
"m2out_dire = dict()\n",
"for move_no in range(1,17):\n",
@ -569,7 +580,7 @@
" m2inc_dire[move_no] = row.inc_dire\n",
" m2out_dire[move_no] = row.out_dire\n",
"\n",
"# (9) 가능한 모든 이동류에 대하여 진입id, 진출id 배정 : matching\n",
"# (8) 가능한 모든 이동류에 대하여 진입id, 진출id 배정 : matching\n",
"self.matching = []\n",
"for parent_id in self.parent_ids:\n",
" inter_no = self.node2inter[parent_id]\n",
@ -583,9 +594,14 @@
" else:\n",
" inc_edge_id = p2move2inc_edge_id[parent_id][move_no]\n",
" out_edge_id = p2move2out_edge_id[parent_id][move_no]\n",
" new_row = pd.DataFrame({'inter_no':[inter_no], 'move_no':[move_no],\n",
" if (inc_edge_id, out_edge_id) in self.n2io2turn[parent_id]:\n",
" turn_type = self.n2io2turn[parent_id][inc_edge_id, out_edge_id]\n",
" else:\n",
" turn_type = 'left' if move_no%2 else 'straight'\n",
" new_row = pd.DataFrame({'inter_no':[inter_no], 'node_id':[parent_id], 'move_no':[move_no],\n",
" 'inc_dire':[inc_dire], 'out_dire':[out_dire],\n",
" 'inc_edge_id':[inc_edge_id], 'out_edge_id':[out_edge_id], 'node_id':[parent_id]})\n",
" 'inc_edge_id':[inc_edge_id], 'out_edge_id':[out_edge_id],\n",
" 'turn_type': turn_type})\n",
" self.matching.append(new_row)\n",
"child_matching = self.match7[self.match7.node_id.isin(self.child_ids)]\n",
"child_matching = child_matching.drop(columns=['inc_angle', 'out_angle'])\n",
@ -593,26 +609,39 @@
"self.matching = self.matching.dropna(subset=['inc_edge_id', 'out_edge_id'])\\\n",
" .sort_values(by=['inter_no', 'node_id', 'move_no']).reset_index(drop=True)\n",
"self.matching['move_no'] = self.matching['move_no'].astype(int)\n",
"display(self.matching)"
"self.matching"
]
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"{('-571542797_02', '571500487_01'): 'straight',\n",
" ('-571500487_01', '571542797_02'): 'straight',\n",
" ('-571500487_01', '571545870_01'): 'left',\n",
" ('-571542797_02', '571510153_01'): 'left',\n",
" ('571545870_02', '571510153_01'): 'straight',\n",
" ('571545870_02', '571542797_02'): 'left',\n",
" ('571510153_02', '571500487_01'): 'left',\n",
" ('571510153_02', '571545870_01'): 'straight'}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m2inc_dire = dict()\n",
"m2out_dire = dict()\n",
"for move_no in range(1,17):\n",
" row = self.nema[self.nema.move_no==move_no].iloc[0]\n",
" m2inc_dire[move_no] = row.inc_dire\n",
" m2out_dire[move_no] = row.out_dire"
"self.n2io2turn['i0']"
]
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 62,
"metadata": {},
"outputs": [
{
@ -637,12 +666,17 @@
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>inter_no</th>\n",
" <th>phase_no</th>\n",
" <th>ring_type</th>\n",
" <th>move_no</th>\n",
" <th>inc_dire</th>\n",
" <th>out_dire</th>\n",
" <th>inc_angle</th>\n",
" <th>out_angle</th>\n",
" <th>inc_edge_id</th>\n",
" <th>out_edge_id</th>\n",
" <th>node_id</th>\n",
" <th>turn_type</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
@ -650,145 +684,326 @@
" <th>0</th>\n",
" <td>175</td>\n",
" <td>1</td>\n",
" <td>동</td>\n",
" <td>A</td>\n",
" <td>8</td>\n",
" <td>남</td>\n",
" <td>571545870_02</td>\n",
" <td>571542797_02</td>\n",
" <td>북</td>\n",
" <td>179</td>\n",
" <td>000</td>\n",
" <td>-571542797_02</td>\n",
" <td>571500487_01</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>175</td>\n",
" <td>1</td>\n",
" <td>B</td>\n",
" <td>4</td>\n",
" <td>북</td>\n",
" <td>남</td>\n",
" <td>001</td>\n",
" <td>180</td>\n",
" <td>-571500487_01</td>\n",
" <td>571542797_02</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>175</td>\n",
" <td>2</td>\n",
" <td>서</td>\n",
" <td>A</td>\n",
" <td>7</td>\n",
" <td>북</td>\n",
" <td>동</td>\n",
" <td>571510153_02</td>\n",
" <td>001</td>\n",
" <td>090</td>\n",
" <td>-571500487_01</td>\n",
" <td>571545870_01</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <th>3</th>\n",
" <td>175</td>\n",
" <td>2</td>\n",
" <td>B</td>\n",
" <td>3</td>\n",
" <td>남</td>\n",
" <td>서</td>\n",
" <td>179</td>\n",
" <td>270</td>\n",
" <td>-571542797_02</td>\n",
" <td>571510153_01</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <th>4</th>\n",
" <td>175</td>\n",
" <td>3</td>\n",
" <td>A</td>\n",
" <td>6</td>\n",
" <td>동</td>\n",
" <td>서</td>\n",
" <td>090</td>\n",
" <td>270</td>\n",
" <td>571545870_02</td>\n",
" <td>571510153_01</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" inter_no phase_no ring_type move_no inc_dire out_dire inc_angle \\\n",
"0 175 1 A 8 남 북 179 \n",
"1 175 1 B 4 북 남 001 \n",
"2 175 2 A 7 북 동 001 \n",
"3 175 2 B 3 남 서 179 \n",
"4 175 3 A 6 동 서 090 \n",
"\n",
" out_angle inc_edge_id out_edge_id node_id turn_type \n",
"0 000 -571542797_02 571500487_01 i0 straight \n",
"1 180 -571500487_01 571542797_02 i0 straight \n",
"2 090 -571500487_01 571545870_01 i0 left \n",
"3 270 -571542797_02 571510153_01 i0 left \n",
"4 270 571545870_02 571510153_01 i0 straight "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>inter_no</th>\n",
" <th>phase_no</th>\n",
" <th>ring_type</th>\n",
" <th>move_no</th>\n",
" <th>inc_dire</th>\n",
" <th>out_dire</th>\n",
" <th>inc_angle</th>\n",
" <th>out_angle</th>\n",
" <th>inc_edge_id</th>\n",
" <th>out_edge_id</th>\n",
" <th>node_id</th>\n",
" <th>turn_type</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>175</td>\n",
" <td>1</td>\n",
" <td>A</td>\n",
" <td>8</td>\n",
" <td>남</td>\n",
" <td>북</td>\n",
" <td>179</td>\n",
" <td>000</td>\n",
" <td>-571542797_02</td>\n",
" <td>571500487_01</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>175</td>\n",
" <td>1</td>\n",
" <td>B</td>\n",
" <td>4</td>\n",
" <td>북</td>\n",
" <td>남</td>\n",
" <td>001</td>\n",
" <td>180</td>\n",
" <td>-571500487_01</td>\n",
" <td>571542797_02</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <th>2</th>\n",
" <td>175</td>\n",
" <td>5</td>\n",
" <td>서</td>\n",
" <td>2</td>\n",
" <td>A</td>\n",
" <td>7</td>\n",
" <td>북</td>\n",
" <td>571510153_02</td>\n",
" <td>571500487_01</td>\n",
" <td>동</td>\n",
" <td>001</td>\n",
" <td>090</td>\n",
" <td>-571500487_01</td>\n",
" <td>571545870_01</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <th>3</th>\n",
" <td>175</td>\n",
" <td>2</td>\n",
" <td>B</td>\n",
" <td>3</td>\n",
" <td>남</td>\n",
" <td>서</td>\n",
" <td>179</td>\n",
" <td>270</td>\n",
" <td>-571542797_02</td>\n",
" <td>571510153_01</td>\n",
" <td>i0</td>\n",
" <td>left</td>\n",
" </tr>\n",
" <tr>\n",
" <th>135</th>\n",
" <td>210</td>\n",
" <td>13</td>\n",
" <td>남서</td>\n",
" <td>북서</td>\n",
" <td>571500585_02</td>\n",
" <td>571500535_01</td>\n",
" <td>i6</td>\n",
" <th>4</th>\n",
" <td>175</td>\n",
" <td>3</td>\n",
" <td>A</td>\n",
" <td>6</td>\n",
" <td>동</td>\n",
" <td>서</td>\n",
" <td>090</td>\n",
" <td>270</td>\n",
" <td>571545870_02</td>\n",
" <td>571510153_01</td>\n",
" <td>i0</td>\n",
" <td>straight</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" inter_no phase_no ring_type move_no inc_dire out_dire inc_angle \\\n",
"0 175 1 A 8 남 북 179 \n",
"1 175 1 B 4 북 남 001 \n",
"2 175 2 A 7 북 동 001 \n",
"3 175 2 B 3 남 서 179 \n",
"4 175 3 A 6 동 서 090 \n",
"\n",
" out_angle inc_edge_id out_edge_id node_id turn_type \n",
"0 000 -571542797_02 571500487_01 i0 straight \n",
"1 180 -571500487_01 571542797_02 i0 straight \n",
"2 090 -571500487_01 571545870_01 i0 left \n",
"3 270 -571542797_02 571510153_01 i0 left \n",
"4 270 571545870_02 571510153_01 i0 straight "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>inter_no</th>\n",
" <th>move_no</th>\n",
" <th>inc_dire</th>\n",
" <th>out_dire</th>\n",
" <th>inc_edge_id</th>\n",
" <th>out_edge_id</th>\n",
" <th>node_id</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>136</th>\n",
" <td>210</td>\n",
" <td>14</td>\n",
" <td>북동</td>\n",
" <td>남서</td>\n",
" <td>571511538_02.121</td>\n",
" <td>571500585_01</td>\n",
" <td>i6</td>\n",
" <th>0</th>\n",
" <td>175</td>\n",
" <td>1</td>\n",
" <td>동</td>\n",
" <td>남</td>\n",
" <td>571545870_02</td>\n",
" <td>571542797_02</td>\n",
" <td>i0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>137</th>\n",
" <td>210</td>\n",
" <td>15</td>\n",
" <td>북서</td>\n",
" <td>북동</td>\n",
" <td>571500535_02.18</td>\n",
" <td>571511538_01</td>\n",
" <td>i6</td>\n",
" <th>1</th>\n",
" <td>175</td>\n",
" <td>2</td>\n",
" <td>서</td>\n",
" <td>동</td>\n",
" <td>571510153_02</td>\n",
" <td>571545870_01</td>\n",
" <td>i0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>138</th>\n",
" <td>210</td>\n",
" <td>16</td>\n",
" <td>남동</td>\n",
" <td>북서</td>\n",
" <td>-571542115_01</td>\n",
" <td>571500535_01</td>\n",
" <td>i6</td>\n",
" <th>2</th>\n",
" <td>175</td>\n",
" <td>3</td>\n",
" <td>남</td>\n",
" <td>서</td>\n",
" <td>-571542797_02</td>\n",
" <td>571510153_01</td>\n",
" <td>i0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>139</th>\n",
" <td>210</td>\n",
" <th>3</th>\n",
" <td>175</td>\n",
" <td>4</td>\n",
" <td>북</td>\n",
" <td>남</td>\n",
" <td>-571500487_01</td>\n",
" <td>571542797_02</td>\n",
" <td>i0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>175</td>\n",
" <td>5</td>\n",
" <td>서</td>\n",
" <td>북</td>\n",
" <td>571500535_02</td>\n",
" <td>-571500535_02</td>\n",
" <td>u60</td>\n",
" <td>571510153_02</td>\n",
" <td>571500487_01</td>\n",
" <td>i0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>140 rows × 7 columns</p>\n",
"</div>"
],
"text/plain": [
" inter_no move_no inc_dire out_dire inc_edge_id out_edge_id \\\n",
"0 175 1 동 남 571545870_02 571542797_02 \n",
"1 175 2 서 동 571510153_02 571545870_01 \n",
"2 175 3 남 서 -571542797_02 571510153_01 \n",
"3 175 4 북 남 -571500487_01 571542797_02 \n",
"4 175 5 서 북 571510153_02 571500487_01 \n",
".. ... ... ... ... ... ... \n",
"135 210 13 남서 북서 571500585_02 571500535_01 \n",
"136 210 14 북동 남서 571511538_02.121 571500585_01 \n",
"137 210 15 북서 북동 571500535_02.18 571511538_01 \n",
"138 210 16 남동 북서 -571542115_01 571500535_01 \n",
"139 210 5 서 북 571500535_02 -571500535_02 \n",
"\n",
" node_id \n",
"0 i0 \n",
"1 i0 \n",
"2 i0 \n",
"3 i0 \n",
"4 i0 \n",
".. ... \n",
"135 i6 \n",
"136 i6 \n",
"137 i6 \n",
"138 i6 \n",
"139 u60 \n",
"\n",
"[140 rows x 7 columns]"
" inter_no move_no inc_dire out_dire inc_edge_id out_edge_id node_id\n",
"0 175 1 동 남 571545870_02 571542797_02 i0\n",
"1 175 2 서 동 571510153_02 571545870_01 i0\n",
"2 175 3 남 서 -571542797_02 571510153_01 i0\n",
"3 175 4 북 남 -571500487_01 571542797_02 i0\n",
"4 175 5 서 북 571510153_02 571500487_01 i0"
]
},
"metadata": {},
@ -796,30 +1011,13 @@
}
],
"source": [
"# (6) 가능한 이동류에 대하여 진입id, 진출id 배정 : matching\n",
"self.matching = []\n",
"for parent_id in self.parent_ids:\n",
" inter_no = self.node2inter[parent_id]\n",
" # 좌회전과 직진(1 ~ 16)\n",
" for move_no in range(1,17):\n",
" inc_dire = m2inc_dire[move_no]\n",
" out_dire = m2out_dire[move_no]\n",
" if move_no in p2move[parent_id]:\n",
" inc_edge_id = inc2id[(parent_id, inc_dire)]\n",
" out_edge_id = out2id[(parent_id, out_dire)]\n",
" else:\n",
" inc_edge_id = p2pm2inc_edge_id[parent_id][move_no]\n",
" out_edge_id = p2pm2out_edge_id[parent_id][move_no]\n",
" new_row = pd.DataFrame({'inter_no':[inter_no], 'move_no':[move_no],\n",
" 'inc_dire':[inc_dire], 'out_dire':[out_dire],\n",
" 'inc_edge_id':[inc_edge_id], 'out_edge_id':[out_edge_id], 'node_id':[parent_id]})\n",
" self.matching.append(new_row)\n",
"self.matching.append(self.match7[self.match7.node_id.isin(self.child_ids)])\n",
"self.matching = pd.concat(self.matching)\n",
"self.matching = self.matching.dropna(subset=['inc_edge_id', 'out_edge_id'])\\\n",
" .sort_values(by=['inter_no', 'node_id', 'move_no']).reset_index(drop=True)\n",
"self.matching['move_no'] = self.matching['move_no'].astype(int)\n",
"display(self.matching)"
"# display(self.match1.head())\n",
"# display(self.match2.head())\n",
"# display(self.match3.head())\n",
"# display(self.match4.head())\n",
"display(self.match5.head())\n",
"display(self.match6.head())\n",
"display(self.matching.head())"
]
}
],

+ 2471
- 0
Analysis/0411_unp-left_p-right-uturn/0416_initialize_state.ipynb
File diff suppressed because it is too large
View File


+ 64
- 64
Intermediates/match6.csv View File

@ -1,34 +1,34 @@
,inter_no,node_id,phase_no,ring_type,move_no,inc_edge_id,out_edge_id,state
0,175,i0,1,A,8,-571542797_02,571500487_01,rrrrrrrrgGGGGrgrr
1,175,i0,1,B,4,-571500487_01,571542797_02,rGGrrrrrgrrrrrgrr
2,175,i0,2,A,7,-571500487_01,571545870_01,rrrGrrrrgrrrrrgrr
3,175,i0,2,B,3,-571542797_02,571510153_01,rrrrrrrrgrrrrGgrr
4,175,i0,3,A,6,571545870_02,571510153_01,rrrrrGGrgrrrrrgrr
5,175,i0,3,B,1,571545870_02,571542797_02,rrrrrrrGgrrrrrgrr
6,175,i0,4,A,5,571510153_02,571500487_01,rrrrrrrrgrrrrrgrG
7,175,i0,4,B,2,571510153_02,571545870_01,rrrrrrrrgrrrrrgGr
8,175,u00,1,A,8,,,ggggggggg
9,175,u00,1,B,4,,,ggggggggg
0,175,i0,1,A,8,-571542797_02,571500487_01,grrrgrrrgGGGGrgrr
1,175,i0,1,B,4,-571500487_01,571542797_02,gGGrgrrrgrrrrrgrr
2,175,i0,2,A,7,-571500487_01,571545870_01,grrGgrrrgrrrrrgrr
3,175,i0,2,B,3,-571542797_02,571510153_01,grrrgrrrgrrrrGgrr
4,175,i0,3,A,6,571545870_02,571510153_01,grrrgGGrgrrrrrgrr
5,175,i0,3,B,1,571545870_02,571542797_02,grrrgrrGgrrrrrgrr
6,175,i0,4,A,5,571510153_02,571500487_01,grrrgrrrgrrrrrgrG
7,175,i0,4,B,2,571510153_02,571545870_01,grrrgrrrgrrrrrgGr
8,175,u00,1,A,8,,,ggggrgggg
9,175,u00,1,B,4,,,ggggrgggg
10,175,u00,2,A,7,571500487_02,571500487_01.32,ggggGgggg
11,175,u00,2,B,3,,,ggggggggg
12,175,u00,3,A,6,,,ggggggggg
13,175,u00,3,B,1,,,ggggggggg
14,175,u00,4,A,5,,,ggggggggg
15,175,u00,4,B,2,,,ggggggggg
16,176,i1,1,A,8,-571542810_01,-571542797_02.99,rrrGGGrrrr
17,176,i1,1,B,4,571542797_02.99,571542810_01,rGGrrrrrrr
18,176,i1,2,A,8,-571542810_01,-571542797_02.99,rrrGGGrrrr
19,176,i1,2,B,3,-571542810_01,571543469_01,rrrrrrGrrr
20,176,i1,3,A,5,571543469_02,-571542797_02.99,rrrrrrrrGG
21,176,i1,3,B,18,,,rrrrrrrrrr
22,177,i2,1,A,8,-571542809_01,571542811_01,rrgrGGG
23,177,i2,1,B,4,571542811_02,571542809_01,GGgrrrr
24,177,i2,2,A,17,,,rrgrrrr
25,177,i2,2,B,18,,,rrgrrrr
26,177,u20,1,A,8,,,gggggg
27,177,u20,1,B,4,,,gggggg
11,175,u00,2,B,3,,,ggggrgggg
12,175,u00,3,A,6,,,ggggrgggg
13,175,u00,3,B,1,,,ggggrgggg
14,175,u00,4,A,5,,,ggggrgggg
15,175,u00,4,B,2,,,ggggrgggg
16,176,i1,1,A,8,-571542810_01,-571542797_02.99,grrGGGrgrr
17,176,i1,1,B,4,571542797_02.99,571542810_01,gGGrrrrgrr
18,176,i1,2,A,8,-571542810_01,-571542797_02.99,grrGGGrgrr
19,176,i1,2,B,3,-571542810_01,571543469_01,grrrrrGgrr
20,176,i1,3,A,5,571543469_02,-571542797_02.99,grrrrrrgGG
21,176,i1,3,B,18,,,grrrrrrgrr
22,177,i2,1,A,8,-571542809_01,571542811_01,rrggGGG
23,177,i2,1,B,4,571542811_02,571542809_01,GGggrrr
24,177,i2,2,A,17,,,rrggrrr
25,177,i2,2,B,18,,,rrggrrr
26,177,u20,1,A,8,,,ggrggg
27,177,u20,1,B,4,,,ggrggg
28,177,u20,2,A,17,571542810_01.51,571542810_02,ggGggg
29,177,u20,2,B,18,,,gggggg
29,177,u20,2,B,18,,,ggrggg
30,178,c30,1,A,20,,,rrrrrr
31,178,c30,1,B,20,,,rrrrrr
32,178,c30,2,A,20,571542116_01,-571542116_02.96,GGGrrr
@ -45,30 +45,30 @@
43,178,i3,3,B,2,571540303_02.21,571500475_01,grrrrgrrrrgrrrrgGGGr
44,178,i3,4,A,6,-571500475_01,571540303_01,grrrrgGGGrgrrrrgrrrr
45,178,i3,4,B,1,-571500475_01,571540304_01,grrrrgrrrGgrrrrgrrrr
46,178,u30,1,A,8,,,gggggggg
47,178,u30,1,B,4,,,gggggggg
48,178,u30,2,A,7,,,gggggggg
49,178,u30,2,B,3,,,gggggggg
50,178,u30,3,A,5,,,gggggggg
51,178,u30,3,B,2,,,gggggggg
46,178,u30,1,A,8,,,ggggrggg
47,178,u30,1,B,4,,,ggggrggg
48,178,u30,2,A,7,,,ggggrggg
49,178,u30,2,B,3,,,ggggrggg
50,178,u30,3,A,5,,,ggggrggg
51,178,u30,3,B,2,,,ggggrggg
52,178,u30,4,A,6,571556452_01,571556452_02,ggggGggg
53,178,u30,4,B,1,,,gggggggg
53,178,u30,4,B,1,,,ggggrggg
54,178,u31,1,A,8,571500475_02,571500475_01.26,ggggGggg
55,178,u31,1,B,4,,,gggggggg
56,178,u31,2,A,7,,,gggggggg
57,178,u31,2,B,3,,,gggggggg
58,178,u31,3,A,5,,,gggggggg
59,178,u31,3,B,2,,,gggggggg
60,178,u31,4,A,6,,,gggggggg
61,178,u31,4,B,1,,,gggggggg
62,178,u32,1,A,8,,,gggggggg
55,178,u31,1,B,4,,,ggggrggg
56,178,u31,2,A,7,,,ggggrggg
57,178,u31,2,B,3,,,ggggrggg
58,178,u31,3,A,5,,,ggggrggg
59,178,u31,3,B,2,,,ggggrggg
60,178,u31,4,A,6,,,ggggrggg
61,178,u31,4,B,1,,,ggggrggg
62,178,u32,1,A,8,,,gggggggr
63,178,u32,1,B,4,571540303_02,-571540303_02,gggggggG
64,178,u32,2,A,7,,,gggggggg
65,178,u32,2,B,3,,,gggggggg
66,178,u32,3,A,5,,,gggggggg
67,178,u32,3,B,2,,,gggggggg
68,178,u32,4,A,6,,,gggggggg
69,178,u32,4,B,1,,,gggggggg
64,178,u32,2,A,7,,,gggggggr
65,178,u32,2,B,3,,,gggggggr
66,178,u32,3,A,5,,,gggggggr
67,178,u32,3,B,2,,,gggggggr
68,178,u32,4,A,6,,,gggggggr
69,178,u32,4,B,1,,,gggggggr
70,201,i8,1,A,8,-571500569_01,571500583_02,grrrrrrrgGGrgrrr
71,201,i8,1,B,3,-571500569_01,571500618_01,grrrrrrrgrrGgrrr
72,201,i8,2,A,5,571500618_02,571500583_02,grrrrrrrgrrrgrrG
@ -83,14 +83,14 @@
81,202,i9,1,B,2,571510152_01,571510152_01.65,rrGG
82,202,i9,2,A,17,,,rrrr
83,202,i9,2,B,18,,,rrrr
84,206,i7,1,A,8,-571511538_02,571542073_02,rrrrrGG
85,206,i7,1,B,4,571542073_01,571511538_02,GGrrrrr
86,206,i7,2,A,17,,,rrrrrrr
87,206,i7,2,B,18,,,rrrrrrr
88,206,i7,3,A,8,-571511538_02,571542073_02,rrrrrGG
89,206,i7,3,B,4,571542073_01,571511538_02,GGrrrrr
90,206,i7,4,A,17,,,rrrrrrr
91,206,i7,4,B,18,,,rrrrrrr
84,206,i7,1,A,8,-571511538_02,571542073_02,rrrggGG
85,206,i7,1,B,4,571542073_01,571511538_02,GGrggrr
86,206,i7,2,A,17,,,rrrggrr
87,206,i7,2,B,18,,,rrrggrr
88,206,i7,3,A,8,-571511538_02,571542073_02,rrrggGG
89,206,i7,3,B,4,571542073_01,571511538_02,GGrggrr
90,206,i7,4,A,17,,,rrrggrr
91,206,i7,4,B,18,,,rrrggrr
92,210,i6,1,A,6,-571542115_01,571500535_01,grrrgGGGrgrrgrrr
93,210,i6,1,B,18,,,grrrgrrrrgrrgrrr
94,210,i6,2,A,5,571500535_02.18,571511538_01,grrrgrrrrgrrgrrG
@ -99,11 +99,11 @@
97,210,i6,3,B,4,571511538_02.121,571500585_01,gGGrgrrrrgrrgrrr
98,210,i6,4,A,8,571500585_02,571511538_01,grrrgrrrrgGGgrrr
99,210,i6,4,B,3,571500585_02,571500535_01,grrrgrrrrgrrgrrr
100,210,u60,1,A,6,,,ggggggggg
101,210,u60,1,B,18,,,ggggggggg
100,210,u60,1,A,6,,,ggggggggr
101,210,u60,1,B,18,,,ggggggggr
102,210,u60,2,A,5,571500535_02,-571500535_02,ggggggggG
103,210,u60,2,B,2,,,ggggggggg
104,210,u60,3,A,7,,,ggggggggg
105,210,u60,3,B,4,,,ggggggggg
106,210,u60,4,A,8,,,ggggggggg
107,210,u60,4,B,3,,,ggggggggg
103,210,u60,2,B,2,,,ggggggggr
104,210,u60,3,A,7,,,ggggggggr
105,210,u60,3,B,4,,,ggggggggr
106,210,u60,4,A,8,,,ggggggggr
107,210,u60,4,B,3,,,ggggggggr

+ 62
- 62
Intermediates/matching.csv View File

@ -1,52 +1,52 @@
inter_no,node_id,move_no,inc_edge_id,out_edge_id,state
175,i0,1,571545870_02,571542797_02,rrrrrrrGgrrrrrgrr
175,i0,2,571510153_02,571545870_01,rrrrrrrrgrrrrrgGr
175,i0,3,-571542797_02,571510153_01,rrrrrrrrgrrrrGgrr
175,i0,4,-571500487_01,571542797_02,rGGrrrrrgrrrrrgrr
175,i0,5,571510153_02,571500487_01,rrrrrrrrgrrrrrgrG
175,i0,6,571545870_02,571510153_01,rrrrrGGrgrrrrrgrr
175,i0,7,-571500487_01,571545870_01,rrrGrrrrgrrrrrgrr
175,i0,8,-571542797_02,571500487_01,rrrrrrrrgGGGGrgrr
175,i0,9,-571500487_01,571545870_01,rrrGrrrrgrrrrrgrr
175,i0,10,571510153_02,571500487_01,rrrrrrrrgrrrrrgrG
175,i0,11,571545870_02,571510153_01,rrrrrGGrgrrrrrgrr
175,i0,12,-571500487_01,571545870_01,rrrGrrrrgrrrrrgrr
175,i0,13,571510153_02,571500487_01,rrrrrrrrgrrrrrgrG
175,i0,14,-571500487_01,571510153_01,Grrrrrrrgrrrrrgrr
175,i0,15,-571500487_01,571500487_01,rrrrrrrrgrrrrrgrr
175,i0,16,571545870_02,571500487_01,rrrrGrrrgrrrrrgrr
176,i1,1,571542797_02.99,571542810_01,rGGrrrrrrr
176,i1,2,571543469_02,-571542797_02.99,rrrrrrrrGG
176,i1,3,-571542810_01,571543469_01,rrrrrrGrrr
176,i1,4,571542797_02.99,571542810_01,rGGrrrrrrr
176,i1,5,571543469_02,-571542797_02.99,rrrrrrrrGG
176,i1,6,571542797_02.99,571543469_01,Grrrrrrrrr
176,i1,7,571542797_02.99,-571542797_02.99,rrrrrrrrrr
176,i1,8,-571542810_01,-571542797_02.99,rrrGGGrrrr
176,i1,9,571542797_02.99,571542810_01,rGGrrrrrrr
176,i1,10,-571542810_01,-571542797_02.99,rrrGGGrrrr
176,i1,11,-571542810_01,571542810_01,rrrrrrrrrr
176,i1,12,571543469_02,571542810_01,rrrrrrrGrr
176,i1,13,-571542810_01,571543469_01,rrrrrrGrrr
176,i1,14,571542797_02.99,571542810_01,rGGrrrrrrr
176,i1,15,571543469_02,-571542797_02.99,rrrrrrrrGG
176,i1,16,-571542810_01,571543469_01,rrrrrrGrrr
177,i2,1,571542107_02,571542809_01,rrgrrrr
175,i0,1,571545870_02,571542797_02,grrrgrrGgrrrrrgrr
175,i0,2,571510153_02,571545870_01,grrrgrrrgrrrrrgGr
175,i0,3,-571542797_02,571510153_01,grrrgrrrgrrrrGgrr
175,i0,4,-571500487_01,571542797_02,gGGrgrrrgrrrrrgrr
175,i0,5,571510153_02,571500487_01,grrrgrrrgrrrrrgrG
175,i0,6,571545870_02,571510153_01,grrrgGGrgrrrrrgrr
175,i0,7,-571500487_01,571545870_01,grrGgrrrgrrrrrgrr
175,i0,8,-571542797_02,571500487_01,grrrgrrrgGGGGrgrr
175,i0,9,-571500487_01,571545870_01,grrGgrrrgrrrrrgrr
175,i0,10,571510153_02,571500487_01,grrrgrrrgrrrrrgrG
175,i0,11,571545870_02,571510153_01,grrrgGGrgrrrrrgrr
175,i0,12,-571500487_01,571545870_01,grrGgrrrgrrrrrgrr
175,i0,13,571510153_02,571500487_01,grrrgrrrgrrrrrgrG
175,i0,14,-571500487_01,571510153_01,Grrrgrrrgrrrrrgrr
175,i0,15,-571500487_01,571500487_01,grrrgrrrgrrrrrgrr
175,i0,16,571545870_02,571500487_01,grrrGrrrgrrrrrgrr
176,i1,1,571542797_02.99,571542810_01,gGGrrrrgrr
176,i1,2,571543469_02,-571542797_02.99,grrrrrrgGG
176,i1,3,-571542810_01,571543469_01,grrrrrGgrr
176,i1,4,571542797_02.99,571542810_01,gGGrrrrgrr
176,i1,5,571543469_02,-571542797_02.99,grrrrrrgGG
176,i1,6,571542797_02.99,571543469_01,Grrrrrrgrr
176,i1,7,571542797_02.99,-571542797_02.99,grrrrrrgrr
176,i1,8,-571542810_01,-571542797_02.99,grrGGGrgrr
176,i1,9,571542797_02.99,571542810_01,gGGrrrrgrr
176,i1,10,-571542810_01,-571542797_02.99,grrGGGrgrr
176,i1,11,-571542810_01,571542810_01,grrrrrrgrr
176,i1,12,571543469_02,571542810_01,grrrrrrGrr
176,i1,13,-571542810_01,571543469_01,grrrrrGgrr
176,i1,14,571542797_02.99,571542810_01,gGGrrrrgrr
176,i1,15,571543469_02,-571542797_02.99,grrrrrrgGG
176,i1,16,-571542810_01,571543469_01,grrrrrGgrr
177,i2,1,571542107_02,571542809_01,rrggrrr
177,i2,2,-571542809_01,571542107_01,rrgGrrr
177,i2,3,-571542809_01,571542809_01,rrgrrrr
177,i2,4,571542811_02,571542809_01,GGgrrrr
177,i2,5,-571542809_01,571542811_01,rrgrGGG
177,i2,6,571542107_02,571542809_01,rrgrrrr
177,i2,7,571542811_02,571542107_01,rrgrrrr
177,i2,8,-571542809_01,571542811_01,rrgrGGG
177,i2,9,571542107_02,571542809_01,rrgrrrr
177,i2,3,-571542809_01,571542809_01,rrggrrr
177,i2,4,571542811_02,571542809_01,GGggrrr
177,i2,5,-571542809_01,571542811_01,rrggGGG
177,i2,6,571542107_02,571542809_01,rrggrrr
177,i2,7,571542811_02,571542107_01,rrggrrr
177,i2,8,-571542809_01,571542811_01,rrggGGG
177,i2,9,571542107_02,571542809_01,rrggrrr
177,i2,10,-571542809_01,571542107_01,rrgGrrr
177,i2,11,-571542809_01,571542809_01,rrgrrrr
177,i2,12,571542811_02,571542809_01,GGgrrrr
177,i2,13,-571542809_01,571542811_01,rrgrGGG
177,i2,14,571542107_02,571542809_01,rrgrrrr
177,i2,15,571542811_02,571542107_01,rrgrrrr
177,i2,16,-571542809_01,571542811_01,rrgrGGG
177,i2,11,-571542809_01,571542809_01,rrggrrr
177,i2,12,571542811_02,571542809_01,GGggrrr
177,i2,13,-571542809_01,571542811_01,rrggGGG
177,i2,14,571542107_02,571542809_01,rrggrrr
177,i2,15,571542811_02,571542107_01,rrggrrr
177,i2,16,-571542809_01,571542811_01,rrggGGG
178,i3,1,-571500475_01,571540304_01,grrrrgrrrGgrrrrgrrrr
178,i3,2,571540303_02.21,571500475_01,grrrrgrrrrgrrrrgGGGr
178,i3,3,571540304_02,571540303_01,grrrrgrrrrgrrrGgrrrr
@ -95,22 +95,22 @@ inter_no,node_id,move_no,inc_edge_id,out_edge_id,state
202,i9,14,571510152_02,-571510152_01,GGrr
202,i9,15,571510152_01,571510152_01.65,rrGG
202,i9,16,571510152_02,-571510152_01,GGrr
206,i7,1,571542071_02,571511538_02,rrrrrrr
206,i7,2,-571511538_02,571542071_01,rrrrGrr
206,i7,3,-571511538_02,571511538_02,rrrrrrr
206,i7,4,571542073_01,571511538_02,GGrrrrr
206,i7,5,-571511538_02,571542073_02,rrrrrGG
206,i7,6,571542071_02,571511538_02,rrrrrrr
206,i7,7,571542073_01,571542071_01,rrGrrrr
206,i7,8,-571511538_02,571542073_02,rrrrrGG
206,i7,9,571542073_01,571542071_01,rrGrrrr
206,i7,10,-571511538_02,571542073_02,rrrrrGG
206,i7,11,571542071_02,571511538_02,rrrrrrr
206,i7,12,571542073_01,571542071_01,rrGrrrr
206,i7,13,-571511538_02,571542073_02,rrrrrGG
206,i7,14,571542073_01,571511538_02,GGrrrrr
206,i7,15,571542073_01,571542073_02,rrrrrrr
206,i7,16,571542071_02,571542073_02,rrrGrrr
206,i7,1,571542071_02,571511538_02,rrrggrr
206,i7,2,-571511538_02,571542071_01,rrrgGrr
206,i7,3,-571511538_02,571511538_02,rrrggrr
206,i7,4,571542073_01,571511538_02,GGrggrr
206,i7,5,-571511538_02,571542073_02,rrrggGG
206,i7,6,571542071_02,571511538_02,rrrggrr
206,i7,7,571542073_01,571542071_01,rrGggrr
206,i7,8,-571511538_02,571542073_02,rrrggGG
206,i7,9,571542073_01,571542071_01,rrGggrr
206,i7,10,-571511538_02,571542073_02,rrrggGG
206,i7,11,571542071_02,571511538_02,rrrggrr
206,i7,12,571542073_01,571542071_01,rrGggrr
206,i7,13,-571511538_02,571542073_02,rrrggGG
206,i7,14,571542073_01,571511538_02,GGrggrr
206,i7,15,571542073_01,571542073_02,rrrggrr
206,i7,16,571542071_02,571542073_02,rrrGgrr
210,i6,1,-571542115_01,571500585_01,grrrgrrrGgrrgrrr
210,i6,2,571500535_02.18,571542115_01,grrrgrrrrgrrgGGr
210,i6,3,571500585_02,571500535_01,grrrgrrrrgrrgrrr

+ 1
- 1
Intermediates/node2init.json View File

@ -1 +1 @@
{"c30": ["r", "r", "r", "r", "r", "r"], "i0": ["r", "r", "r", "r", "r", "r", "r", "r", "g", "r", "r", "r", "r", "r", "g", "r", "r"], "i1": ["r", "r", "r", "r", "r", "r", "r", "r", "r", "r"], "i2": ["r", "r", "g", "r", "r", "r", "r"], "i3": ["g", "r", "r", "r", "r", "g", "r", "r", "r", "r", "g", "r", "r", "r", "r", "g", "r", "r", "r", "r"], "i6": ["g", "r", "r", "r", "g", "r", "r", "r", "r", "g", "r", "r", "g", "r", "r", "r"], "i7": ["r", "r", "r", "r", "r", "r", "r"], "i8": ["g", "r", "r", "r", "r", "r", "r", "r", "g", "r", "r", "r", "g", "r", "r", "r"], "i9": ["r", "r", "r", "r"], "u00": ["g", "g", "g", "g", "g", "g", "g", "g", "g"], "u20": ["g", "g", "g", "g", "g", "g"], "u30": ["g", "g", "g", "g", "g", "g", "g", "g"], "u31": ["g", "g", "g", "g", "g", "g", "g", "g"], "u32": ["g", "g", "g", "g", "g", "g", "g", "g"], "u60": ["g", "g", "g", "g", "g", "g", "g", "g", "g"]}
{"c30": ["r", "r", "r", "r", "r", "r"], "i0": ["g", "r", "r", "r", "g", "r", "r", "r", "g", "r", "r", "r", "r", "r", "g", "r", "r"], "i1": ["g", "r", "r", "r", "r", "r", "r", "g", "r", "r"], "i2": ["r", "r", "g", "g", "r", "r", "r"], "i3": ["g", "r", "r", "r", "r", "g", "r", "r", "r", "r", "g", "r", "r", "r", "r", "g", "r", "r", "r", "r"], "i6": ["g", "r", "r", "r", "g", "r", "r", "r", "r", "g", "r", "r", "g", "r", "r", "r"], "i7": ["r", "r", "r", "g", "g", "r", "r"], "i8": ["g", "r", "r", "r", "r", "r", "r", "r", "g", "r", "r", "r", "g", "r", "r", "r"], "i9": ["r", "r", "r", "r"], "u00": ["g", "g", "g", "g", "r", "g", "g", "g", "g"], "u20": ["g", "g", "r", "g", "g", "g"], "u30": ["g", "g", "g", "g", "r", "g", "g", "g"], "u31": ["g", "g", "g", "g", "r", "g", "g", "g"], "u32": ["g", "g", "g", "g", "g", "g", "g", "r"], "u60": ["g", "g", "g", "g", "g", "g", "g", "g", "r"]}

+ 307
- 375
Results/sn_1704417600.add.xml View File

@ -1,233 +1,189 @@
<additional>
<tlLogic id="c30" type="static" programID="c30_prog" offset="-90">
<tlLogic id="c30" type="static" programID="c30_prog" offset="-130">
<phase duration="34" state="rrrrrr"/>
<phase duration="4" state="rrrrrr"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="34" state="GGGGGG"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="33" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="38" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="37" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="17" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="16" state="GGGGGG"/>
<phase duration="4" state="yyyyyy"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="33" state="rrrrrr"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="32" state="rrrrrr"/>
<phase duration="4" state="rrrrrr"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="34" state="GGGGGG"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="33" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="38" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="37" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="17" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="16" state="GGGGGG"/>
<phase duration="4" state="yyyyyy"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="33" state="rrrrrr"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="32" state="rrrrrr"/>
<phase duration="4" state="rrrrrr"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="34" state="GGGGGG"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="33" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="38" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="37" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="17" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="16" state="GGGGGG"/>
<phase duration="4" state="yyyyyy"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="33" state="rrrrrr"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="32" state="rrrrrr"/>
<phase duration="4" state="rrrrrr"/>
<phase duration="1" state="rrrrrr"/>
<phase duration="34" state="GGGGGG"/>
<phase duration="2" state="rrrrrr"/>
<phase duration="33" state="GGGGGG"/>
<phase duration="4" state="GGGGGG"/>
<phase duration="1" state="GGGGGG"/>
<phase duration="38" state="GGGGGG"/>
<phase duration="2" state="GGGGGG"/>
<phase duration="37" state="GGGGGG"/>
</tlLogic>
<tlLogic id="i0" type="static" programID="i0_prog" offset="-159">
<phase duration="39" state="gGGrgrrrgGGGGrgrr"/>
<phase duration="4" state="gyyrgrrrgyyyyrgrr"/>
<phase duration="1" state="grrrgrrrgrrrrrgrr"/>
<phase duration="40" state="grrGgrrrgrrrrGgrr"/>
<phase duration="4" state="grrygrrrgrrrrygrr"/>
<phase duration="1" state="grrrgGGrgrrrrrgrr"/>
<phase duration="28" state="grrrgGGGgrrrrrgrr"/>
<phase duration="4" state="grrrgGGygrrrrrgrr"/>
<phase duration="1" state="grrrgGGrgrrrrrgGr"/>
<phase duration="17" state="grrrgGGrgrrrrrgGr"/>
<phase duration="4" state="grrrgyyrgrrrrrgGr"/>
<phase duration="1" state="grrrgrrrgrrrrrgGr"/>
<phase duration="32" state="grrrgrrrgrrrrrgGG"/>
<phase duration="4" state="grrrgrrrgrrrrrgyy"/>
<phase duration="1" state="grrrgrrrgrrrrrgrr"/>
<tlLogic id="i0" type="static" programID="i0_prog" offset="-60">
<phase duration="38" state="gGGrgrrrgGGGGrgrr"/>
<phase duration="4" state="gyyrgrrrgyyyyrgrr"/>
<phase duration="1" state="grrrgrrrgrrrrrgrr"/>
<phase duration="40" state="grrGgrrrgrrrrGgrr"/>
<phase duration="4" state="grrygrrrgrrrrygrr"/>
<phase duration="1" state="grrrgGGrgrrrrrgrr"/>
<phase duration="28" state="grrrgGGGgrrrrrgrr"/>
<phase duration="4" state="grrrgGGygrrrrrgrr"/>
<phase duration="1" state="grrrgGGrgrrrrrgGr"/>
<phase duration="17" state="grrrgGGrgrrrrrgGr"/>
<phase duration="4" state="grrrgyyrgrrrrrgGr"/>
<phase duration="1" state="grrrgrrrgrrrrrgGr"/>
<phase duration="32" state="grrrgrrrgrrrrrgGG"/>
<phase duration="4" state="grrrgrrrgrrrrrgyy"/>
<phase duration="1" state="grrrgrrrgrrrrrgrr"/>
<phase duration="38" state="gGGrgrrrgGGGGrgrr"/>
<phase duration="4" state="gyyrgrrrgyyyyrgrr"/>
<phase duration="1" state="grrrgrrrgrrrrrgrr"/>
<phase duration="40" state="grrGgrrrgrrrrGgrr"/>
<phase duration="4" state="grrygrrrgrrrrygrr"/>
<phase duration="1" state="grrrgGGrgrrrrrgrr"/>
<phase duration="28" state="grrrgGGGgrrrrrgrr"/>
<phase duration="5" state="gyyrgrrrgyyyyrgrr"/>
<phase duration="2" state="grrrgrrrgrrrrrgrr"/>
<phase duration="38" state="grrGgrrrgrrrrGgrr"/>
<phase duration="5" state="grrygrrrgrrrrygrr"/>
<phase duration="2" state="grrrgGGrgrrrrrgrr"/>
<phase duration="26" state="grrrgGGGgrrrrrgrr"/>
<phase duration="5" state="grrrgGGygrrrrrgrr"/>
<phase duration="2" state="grrrgGGrgrrrrrgGr"/>
<phase duration="15" state="grrrgGGrgrrrrrgGr"/>
<phase duration="5" state="grrrgyyrgrrrrrgGr"/>
<phase duration="2" state="grrrgrrrgrrrrrgGr"/>
<phase duration="30" state="grrrgrrrgrrrrrgGG"/>
<phase duration="5" state="grrrgrrrgrrrrrgyy"/>
<phase duration="2" state="grrrgrrrgrrrrrgrr"/>
<phase duration="36" state="gGGrgrrrgGGGGrgrr"/>
<phase duration="5" state="gyyrgrrrgyyyyrgrr"/>
<phase duration="2" state="grrrgrrrgrrrrrgrr"/>
<phase duration="38" state="grrGgrrrgrrrrGgrr"/>
<phase duration="5" state="grrygrrrgrrrrygrr"/>
<phase duration="2" state="grrrgGGrgrrrrrgrr"/>
<phase duration="26" state="grrrgGGGgrrrrrgrr"/>
<phase duration="5" state="grrrgGGygrrrrrgrr"/>
<phase duration="2" state="grrrgGGrgrrrrrgGr"/>
<phase duration="15" state="grrrgGGrgrrrrrgGr"/>
<phase duration="5" state="grrrgyyrgrrrrrgGr"/>
<phase duration="2" state="grrrgrrrgrrrrrgGr"/>
<phase duration="30" state="grrrgrrrgrrrrrgGG"/>
<phase duration="5" state="grrrgrrrgrrrrrgyy"/>
<phase duration="2" state="grrrgrrrgrrrrrgrr"/>
<phase duration="36" state="gGGrgrrrgGGGGrgrr"/>
<phase duration="5" state="gyyrgrrrgyyyyrgrr"/>
<phase duration="2" state="grrrgrrrgrrrrrgrr"/>
<phase duration="38" state="grrGgrrrgrrrrGgrr"/>
<phase duration="5" state="grrygrrrgrrrrygrr"/>
<phase duration="2" state="grrrgGGrgrrrrrgrr"/>
<phase duration="26" state="grrrgGGGgrrrrrgrr"/>
<phase duration="22" state="grrrgGGygrrrrrgrr"/>
</tlLogic>
<tlLogic id="i1" type="static" programID="i1_prog" offset="-90">
<tlLogic id="i1" type="static" programID="i1_prog" offset="-60">
<phase duration="33" state="gGGGGGrgrr"/>
<phase duration="4" state="gyyGGGrgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="0" state="grrGGGGgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="99" state="grrGGGGgrr"/>
<phase duration="1" state="grrGGGrgrr"/>
<phase duration="98" state="grrGGGGgrr"/>
<phase duration="4" state="grryyyygrr"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="0" state="grrrrrrgGG"/>
<phase duration="36" state="grrrrrrgGG"/>
<phase duration="1" state="grrrrrrgrr"/>
<phase duration="35" state="grrrrrrgGG"/>
<phase duration="4" state="grrrrrrgyy"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="0" state="gGGrrrrgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="33" state="gGGGGGrgrr"/>
<phase duration="1" state="grrrrrrgrr"/>
<phase duration="32" state="gGGGGGrgrr"/>
<phase duration="4" state="gyyGGGrgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="0" state="grrGGGGgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="99" state="grrGGGGgrr"/>
<phase duration="1" state="grrGGGrgrr"/>
<phase duration="98" state="grrGGGGgrr"/>
<phase duration="4" state="grryyyygrr"/>
<phase duration="0" state="grrrrrrgGG"/>
<phase duration="0" state="grrrrrrgGG"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="36" state="grrrrrrgrr"/>
<phase duration="1" state="grrrrrrgrr"/>
<phase duration="35" state="grrrrrrgGG"/>
<phase duration="4" state="grrrrrrgyy"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="0" state="gGGrrrrgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="33" state="gGGGGGrgrr"/>
<phase duration="1" state="grrrrrrgrr"/>
<phase duration="32" state="gGGGGGrgrr"/>
<phase duration="4" state="gyyGGGrgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="0" state="grrGGGGgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="99" state="grrGGGGgrr"/>
<phase duration="1" state="grrGGGrgrr"/>
<phase duration="98" state="grrGGGGgrr"/>
<phase duration="4" state="grryyyygrr"/>
<phase duration="0" state="grrrrrrgGG"/>
<phase duration="0" state="grrrrrrgGG"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="36" state="grrrrrrgrr"/>
<phase duration="1" state="grrrrrrgrr"/>
<phase duration="35" state="grrrrrrgGG"/>
<phase duration="4" state="grrrrrrgyy"/>
<phase duration="0" state="grrrrrrgrr"/>
<phase duration="0" state="gGGrrrrgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="33" state="gGGGGGrgrr"/>
<phase duration="1" state="grrrrrrgrr"/>
<phase duration="32" state="gGGGGGrgrr"/>
<phase duration="4" state="gyyGGGrgrr"/>
<phase duration="0" state="grrGGGGgrr"/>
<phase duration="0" state="grrGGGrgrr"/>
<phase duration="0" state="grrGGGGgrr"/>
<phase duration="99" state="grrGGGrgrr"/>
<phase duration="1" state="grrGGGrgrr"/>
<phase duration="98" state="grrGGGGgrr"/>
</tlLogic>
<tlLogic id="i2" type="static" programID="i2_prog" offset="-180">
<phase duration="38" state="GGgrGGG"/>
<phase duration="5" state="yygryyy"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="21" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="64" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="34" state="rrgrGGG"/>
<phase duration="5" state="rrgrGGG"/>
<phase duration="1" state="rrgrGGG"/>
<phase duration="37" state="GGgrGGG"/>
<phase duration="5" state="yygryyy"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="21" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="64" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="34" state="rrgrGGG"/>
<phase duration="5" state="rrgrGGG"/>
<phase duration="1" state="rrgrGGG"/>
<phase duration="37" state="GGgrGGG"/>
<phase duration="5" state="yygryyy"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="21" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="64" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="34" state="rrgrGGG"/>
<phase duration="5" state="rrgrGGG"/>
<phase duration="1" state="rrgrGGG"/>
<phase duration="37" state="GGgrGGG"/>
<phase duration="5" state="yygryyy"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="21" state="rrgrrrr"/>
<phase duration="5" state="rrgrrrr"/>
<phase duration="1" state="rrgrrrr"/>
<phase duration="64" state="rrgrrrr"/>
<tlLogic id="i2" type="static" programID="i2_prog" offset="-130">
<phase duration="38" state="GGggGGG"/>
<phase duration="5" state="yyggyyy"/>
<phase duration="1" state="rrggrrr"/>
<phase duration="21" state="rrggrrr"/>
<phase duration="5" state="rrggrrr"/>
<phase duration="1" state="rrggrrr"/>
<phase duration="37" state="GGggGGG"/>
<phase duration="5" state="yyggyyy"/>
<phase duration="1" state="rrggrrr"/>
<phase duration="21" state="rrggrrr"/>
<phase duration="5" state="rrggrrr"/>
<phase duration="1" state="rrggrrr"/>
<phase duration="37" state="GGggGGG"/>
<phase duration="5" state="yyggyyy"/>
<phase duration="1" state="rrggrrr"/>
<phase duration="21" state="rrggrrr"/>
<phase duration="5" state="rrggrrr"/>
<phase duration="1" state="rrggrrr"/>
<phase duration="37" state="GGggGGG"/>
</tlLogic>
<tlLogic id="i3" type="static" programID="i3_prog" offset="-90">
<tlLogic id="i3" type="static" programID="i3_prog" offset="-130">
<phase duration="34" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="4" state="gyyyrgrrrrgyyyrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="34" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="4" state="grrrygrrrrgrrrygrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="38" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="37" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="4" state="grrrrgrrrrgrrrrgyyyy"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="17" state="grrrrgGGGGgrrrrgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="16" state="grrrrgGGGGgrrrrgrrrr"/>
<phase duration="4" state="grrrrgyyyygrrrrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="32" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="4" state="gyyyrgrrrrgyyyrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="34" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="4" state="grrrygrrrrgrrrygrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="38" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="37" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="4" state="grrrrgrrrrgrrrrgyyyy"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="17" state="grrrrgGGGGgrrrrgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="16" state="grrrrgGGGGgrrrrgrrrr"/>
<phase duration="4" state="grrrrgyyyygrrrrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="32" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="4" state="gyyyrgrrrrgyyyrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="34" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="4" state="grrrygrrrrgrrrygrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="38" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="37" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="4" state="grrrrgrrrrgrrrrgyyyy"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="17" state="grrrrgGGGGgrrrrgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="16" state="grrrrgGGGGgrrrrgrrrr"/>
<phase duration="4" state="grrrrgyyyygrrrrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="32" state="gGGGrgrrrrgGGGrgrrrr"/>
<phase duration="4" state="gyyyrgrrrrgyyyrgrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="34" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="33" state="grrrGgrrrrgrrrGgrrrr"/>
<phase duration="4" state="grrrygrrrrgrrrygrrrr"/>
<phase duration="1" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="38" state="grrrrgrrrrgrrrrgGGGG"/>
<phase duration="2" state="grrrrgrrrrgrrrrgrrrr"/>
<phase duration="37" state="grrrrgrrrrgrrrrgGGGG"/>
</tlLogic>
<tlLogic id="i6" type="static" programID="i6_prog" offset="-131">
<tlLogic id="i6" type="static" programID="i6_prog" offset="-20">
<phase duration="1" state="grrrgGGGrgrrgrrr"/>
<phase duration="23" state="grrrgGGGrgrrgrrr"/>
<phase duration="4" state="grrrgGGGrgrrgrrr"/>
@ -285,52 +241,52 @@
<phase duration="1" state="grrrgrrrrgrrgrrr"/>
<phase duration="65" state="gGGGgrrrrgrrgrrr"/>
</tlLogic>
<tlLogic id="i7" type="static" programID="i7_prog" offset="-61">
<phase duration="40" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<tlLogic id="i7" type="static" programID="i7_prog" offset="-60">
<phase duration="41" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="47" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="48" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<phase duration="21" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="21" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="39" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<phase duration="40" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="47" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="48" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<phase duration="21" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="21" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="39" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<phase duration="40" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="47" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="48" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<phase duration="21" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="21" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="39" state="GGrggGG"/>
<phase duration="5" state="yyrggyy"/>
<phase duration="40" state="GGrggGG"/>
<phase duration="4" state="yyrggyy"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="47" state="rrrggrr"/>
<phase duration="5" state="rrrggrr"/>
<phase duration="48" state="rrrggrr"/>
<phase duration="4" state="rrrggrr"/>
<phase duration="1" state="rrrggrr"/>
<phase duration="20" state="GGrggGG"/>
<phase duration="21" state="GGrggGG"/>
</tlLogic>
<tlLogic id="i8" type="static" programID="i8_prog" offset="-100">
<tlLogic id="i8" type="static" programID="i8_prog" offset="-20">
<phase duration="29" state="grrrrrrrgGGGgrrr"/>
<phase duration="4" state="grrrrrrrgyyygrrr"/>
<phase duration="2" state="grrrrrrrgrrrgrrr"/>
@ -387,248 +343,224 @@
<phase duration="2" state="grrrGGGrgrrrgrrr"/>
<phase duration="52" state="grrrGGGGgrrrgrrr"/>
</tlLogic>
<tlLogic id="i9" type="static" programID="i9_prog" offset="-9">
<tlLogic id="i9" type="static" programID="i9_prog" offset="-100">
<phase duration="42" state="GGGG"/>
<phase duration="4" state="yyyy"/>
<phase duration="1" state="rrrr"/>
<phase duration="109" state="rrrr"/>
<phase duration="2" state="rrrr"/>
<phase duration="108" state="rrrr"/>
<phase duration="4" state="rrrr"/>
<phase duration="1" state="rrrr"/>
<phase duration="41" state="GGGG"/>
<phase duration="2" state="rrrr"/>
<phase duration="40" state="GGGG"/>
<phase duration="4" state="yyyy"/>
<phase duration="1" state="rrrr"/>
<phase duration="109" state="rrrr"/>
<phase duration="2" state="rrrr"/>
<phase duration="108" state="rrrr"/>
<phase duration="4" state="rrrr"/>
<phase duration="1" state="rrrr"/>
<phase duration="41" state="GGGG"/>
<phase duration="2" state="rrrr"/>
<phase duration="40" state="GGGG"/>
<phase duration="4" state="yyyy"/>
<phase duration="1" state="rrrr"/>
<phase duration="109" state="rrrr"/>
<phase duration="2" state="rrrr"/>
<phase duration="108" state="rrrr"/>
<phase duration="4" state="rrrr"/>
<phase duration="1" state="rrrr"/>
<phase duration="41" state="GGGG"/>
<phase duration="2" state="rrrr"/>
<phase duration="40" state="GGGG"/>
</tlLogic>
<tlLogic id="u00" type="static" programID="u00_prog" offset="-159">
<phase duration="39" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="40" state="ggggGgggg"/>
<phase duration="4" state="ggggygggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="28" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="17" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="32" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="38" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="40" state="ggggGgggg"/>
<phase duration="4" state="ggggygggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="28" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="17" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="32" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<tlLogic id="u00" type="static" programID="u00_prog" offset="-60">
<phase duration="38" state="ggggrgggg"/>
<phase duration="4" state="ggggrgggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="40" state="ggggGgggg"/>
<phase duration="4" state="ggggygggg"/>
<phase duration="1" state="ggggrgggg"/>
<phase duration="28" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="38" state="ggggGgggg"/>
<phase duration="5" state="ggggygggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="26" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="15" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="30" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="36" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="38" state="ggggGgggg"/>
<phase duration="5" state="ggggygggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="26" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="15" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="30" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="36" state="ggggrgggg"/>
<phase duration="5" state="ggggrgggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="38" state="ggggGgggg"/>
<phase duration="5" state="ggggygggg"/>
<phase duration="2" state="ggggrgggg"/>
<phase duration="26" state="ggggrgggg"/>
<phase duration="22" state="ggggrgggg"/>
</tlLogic>
<tlLogic id="u20" type="static" programID="u20_prog" offset="-180">
<tlLogic id="u20" type="static" programID="u20_prog" offset="-130">
<phase duration="38" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="21" state="ggGggg"/>
<phase duration="5" state="ggyggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="64" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="34" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="37" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="21" state="ggGggg"/>
<phase duration="5" state="ggyggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="64" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="34" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="37" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="21" state="ggGggg"/>
<phase duration="5" state="ggyggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="64" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="34" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="37" state="ggrggg"/>
<phase duration="5" state="ggrggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="21" state="ggGggg"/>
<phase duration="5" state="ggyggg"/>
<phase duration="1" state="ggrggg"/>
<phase duration="64" state="ggrggg"/>
</tlLogic>
<tlLogic id="u30" type="static" programID="u30_prog" offset="-90">
<tlLogic id="u30" type="static" programID="u30_prog" offset="-130">
<phase duration="34" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="17" state="ggggGggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="16" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="32" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="17" state="ggggGggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="16" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="32" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="17" state="ggggGggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="16" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="32" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
</tlLogic>
<tlLogic id="u31" type="static" programID="u31_prog" offset="-90">
<tlLogic id="u31" type="static" programID="u31_prog" offset="-130">
<phase duration="34" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="17" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="16" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="33" state="ggggGggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="32" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="17" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="16" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="33" state="ggggGggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="32" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="17" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="16" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="33" state="ggggGggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="32" state="ggggGggg"/>
<phase duration="4" state="ggggyggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="34" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="33" state="ggggrggg"/>
<phase duration="4" state="ggggrggg"/>
<phase duration="1" state="ggggrggg"/>
<phase duration="38" state="ggggrggg"/>
<phase duration="2" state="ggggrggg"/>
<phase duration="37" state="ggggrggg"/>
</tlLogic>
<tlLogic id="u32" type="static" programID="u32_prog" offset="-90">
<tlLogic id="u32" type="static" programID="u32_prog" offset="-130">
<phase duration="34" state="gggggggG"/>
<phase duration="4" state="gggggggy"/>
<phase duration="1" state="gggggggr"/>
<phase duration="34" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="33" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="38" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="37" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="17" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="16" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="33" state="gggggggG"/>
<phase duration="2" state="gggggggr"/>
<phase duration="32" state="gggggggG"/>
<phase duration="4" state="gggggggy"/>
<phase duration="1" state="gggggggr"/>
<phase duration="34" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="33" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="38" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="37" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="17" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="16" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="33" state="gggggggG"/>
<phase duration="2" state="gggggggr"/>
<phase duration="32" state="gggggggG"/>
<phase duration="4" state="gggggggy"/>
<phase duration="1" state="gggggggr"/>
<phase duration="34" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="33" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="38" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="37" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="17" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="16" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="33" state="gggggggG"/>
<phase duration="2" state="gggggggr"/>
<phase duration="32" state="gggggggG"/>
<phase duration="4" state="gggggggy"/>
<phase duration="1" state="gggggggr"/>
<phase duration="34" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="33" state="gggggggr"/>
<phase duration="4" state="gggggggr"/>
<phase duration="1" state="gggggggr"/>
<phase duration="38" state="gggggggr"/>
<phase duration="2" state="gggggggr"/>
<phase duration="37" state="gggggggr"/>
</tlLogic>
<tlLogic id="u60" type="static" programID="u60_prog" offset="-131">
<tlLogic id="u60" type="static" programID="u60_prog" offset="-20">
<phase duration="1" state="ggggggggr"/>
<phase duration="23" state="ggggggggr"/>
<phase duration="4" state="ggggggggr"/>

BIN
Scripts/__pycache__/preprocess_daily.cpython-38.pyc View File


+ 39
- 42
Scripts/preprocess_daily.py View File

@ -403,13 +403,13 @@ class DailyPreprocessor():
self.match5 = self.match5.sort_values(by=['inter_no','phase_no','ring_type']).reset_index(drop=True)
# n2io2turn : dictionary that maps node_id to io2turn
n2io2turn = dict()
self.n2io2turn = dict()
for node_id in self.parent_ids:
turn = self.turn_type[self.turn_type.node_id==node_id]
io = list(zip(turn.inc_edge_id, turn.out_edge_id))
# io2turn : dictionary that maps (inc_edge_id, out_edge_id) to turn_type
io2turn = dict(zip(io, turn.turn_type))
n2io2turn[node_id] = io2turn
self.n2io2turn[node_id] = io2turn
# turn_type 지정
for i, row in self.match5.iterrows():
@ -417,7 +417,7 @@ class DailyPreprocessor():
inc_edge_id = row.inc_edge_id
out_edge_id = row.out_edge_id
if not (pd.isna(inc_edge_id) and pd.isna(out_edge_id)):
turn_type = n2io2turn[node_id][(inc_edge_id, out_edge_id)]
turn_type = self.n2io2turn[node_id][(inc_edge_id, out_edge_id)]
self.match5.at[i, 'turn_type'] = turn_type
# 2-1-6
@ -427,7 +427,6 @@ class DailyPreprocessor():
: inter_no, phase_no, ring_type, move_no, inc_dire, out_dire, inc_angle, out_angle, inc_edge_id, out_edge_id, node_id
'''
self.u_turn = pd.merge(self.u_turn, self.u_condition, on='child_id')
# p2inc_edge2angle : node_id to inc_edge2angle
@ -454,6 +453,8 @@ class DailyPreprocessor():
out_angle2edge = dict(zip(m5.out_angle.astype(int), m5.out_edge_id))
p2out_angle2edge[node_id] = out_angle2edge
self.uid2uindex = dict() # u_turn node id to u_turn index
# 각 uturn node에 대하여 (inc_edge_id, out_edge_id) 부여
cmatches = []
for row in self.u_turn.itertuples():
@ -464,7 +465,13 @@ class DailyPreprocessor():
out_edge_id = row.out_edge_id
adj_inc_edge_id = row.adj_inc_edge_id
adj_out_edge_id = row.adj_out_edge_id
# self.uid2uindex 지정
inc_edge = self.net.getEdge(inc_edge_id)
out_edge = self.net.getEdge(out_edge_id)
u_turn_conn = inc_edge.getConnections(out_edge)[0]
self.uid2uindex[child_id] = u_turn_conn.getTLLinkIndex()
# match5에서 부모노드id에 해당하는 행들을 가져옴 (cmatch)
cmatch = self.match5.copy()[self.match5.node_id==parent_id] # match dataframe for a child node
cmatch = cmatch.sort_values(by=['phase_no', 'ring_type']).reset_index(drop=True)
@ -554,12 +561,15 @@ class DailyPreprocessor():
self.coord['move_no'] = 20
self.coord = self.coord[['inter_no', 'phase_no', 'ring_type', 'move_no', 'inc_dire', 'out_dire', 'inc_angle','out_angle', 'inc_edge_id', 'out_edge_id', 'node_id']]
# display(coord)
cmatches = pd.concat(cmatches)
self.match6 = pd.concat([self.match5, cmatches, self.coord]).drop_duplicates().sort_values(by=['inter_no', 'node_id', 'phase_no', 'ring_type'])
self.match6 = self.match6.reset_index(drop=True)
# self.match6.to_csv(os.path.join(self.path_intermediates, 'match6.csv'))
# json 파일로 저장 # to be deprecated
with open(os.path.join(self.path_intermediates, 'uid2uindex.json'), 'w') as file:
json.dump(self.uid2uindex, file)
# 2-1-7
def make_matching(self):
@ -572,44 +582,42 @@ class DailyPreprocessor():
self.match7 = self.match6.copy()
self.match7 = self.match7[['inter_no', 'node_id', 'move_no', 'inc_angle', 'out_angle', 'inc_dire', 'out_dire', 'inc_edge_id', 'out_edge_id']]
# (1) 가능한 (진입방향, 진출방향) 목록
flows = self.nema.dropna().apply(lambda row: (row['inc_dire'], row['out_dire']), axis=1).tolist()
# (2) 각 교차로별 방향 목록 : pdires (possible directions)
# (1) 각 교차로별 방향 목록 : pdires (possible directions)
p2dires = {} # parent_id to directions
for parent_id in self.parent_ids:
dires = self.match7[self.match7.node_id == parent_id][['inc_dire','out_dire']].values.flatten()
dires = {dire for dire in dires if type(dire)==str}
p2dires[parent_id] = dires
# (3) 각 (교차로, 진입방향) 별 진입id 목록 : inc2id (incoming direction to incoming edge_id)
# (2) 각 (교차로, 진입방향) 별 진입id 목록 : inc2id (incoming direction to incoming edge_id)
inc2id = {}
for parent_id in self.parent_ids:
for inc_dire in p2dires[parent_id]:
df = self.match7[(self.match7.node_id==parent_id) & (self.match7.inc_dire==inc_dire)]
inc2id[(parent_id, inc_dire)] = df.inc_edge_id.iloc[0]
# (4) 각 (교차로, 진출방향) 별 진출id 목록 : out2id (outgoing direction to outgoing edge_id)
# (3) 각 (교차로, 진출방향) 별 진출id 목록 : out2id (outgoing direction to outgoing edge_id)
out2id = {}
for parent_id in self.parent_ids:
for out_dire in p2dires[parent_id]:
df = self.match7[(self.match7.node_id==parent_id) & (self.match7.out_dire==out_dire)]
out2id[(parent_id, out_dire)] = df.out_edge_id.iloc[0]
# (5) 각 parent_id별 이동류번호 목록
# (4) 각 parent_id별 이동류번호 목록
p2move = dict() # parent id to a list of aligned movement numbers
for parent_id in self.parent_ids:
pnema = self.nema[self.nema.inc_dire.isin(p2dires[parent_id]) & self.nema.out_dire.isin(p2dires[parent_id])]
p2move[parent_id] = list(pnema.move_no)
# (6) 방위별 방향벡터
# (5) 방위별 방향벡터
dire2vec = dict() # direction to unit vector
theta = np.pi/2
for dire in self.dires:
dire2vec[dire] = np.array([np.cos(theta), np.sin(theta)])
theta -= np.pi/4
# (7) 각 parent_id별 : 각 이동류별 진입/진출 엣지 id
# (6) 각 parent_id별 : 각 이동류별 진입/진출 엣지 id
p2move2inc_edge_id = dict() # parent id to move2inc_edge_id
p2move2out_edge_id = dict() # parent id to move2out_edge_id
for parent_id in self.parent_ids:
@ -651,7 +659,7 @@ class DailyPreprocessor():
p2move2inc_edge_id[parent_id] = move2inc_edge_id
p2move2out_edge_id[parent_id] = move2out_edge_id
# (8) 각 이동류별 진입/진출 방위
# (7) 각 이동류별 진입/진출 방위
m2inc_dire = dict()
m2out_dire = dict()
for move_no in range(1,17):
@ -659,7 +667,7 @@ class DailyPreprocessor():
m2inc_dire[move_no] = row.inc_dire
m2out_dire[move_no] = row.out_dire
# (9) 가능한 모든 이동류에 대하여 진입id, 진출id 배정 : matching
# (8) 가능한 모든 이동류에 대하여 진입id, 진출id 배정 : matching
self.matching = []
for parent_id in self.parent_ids:
inter_no = self.node2inter[parent_id]
@ -673,9 +681,14 @@ class DailyPreprocessor():
else:
inc_edge_id = p2move2inc_edge_id[parent_id][move_no]
out_edge_id = p2move2out_edge_id[parent_id][move_no]
new_row = pd.DataFrame({'inter_no':[inter_no], 'move_no':[move_no],
if (inc_edge_id, out_edge_id) in self.n2io2turn[parent_id]:
turn_type = self.n2io2turn[parent_id][inc_edge_id, out_edge_id]
else:
turn_type = 'left' if move_no%2 else 'straight'
new_row = pd.DataFrame({'inter_no':[inter_no], 'node_id':[parent_id], 'move_no':[move_no],
'inc_dire':[inc_dire], 'out_dire':[out_dire],
'inc_edge_id':[inc_edge_id], 'out_edge_id':[out_edge_id], 'node_id':[parent_id]})
'inc_edge_id':[inc_edge_id], 'out_edge_id':[out_edge_id],
'turn_type': turn_type})
self.matching.append(new_row)
child_matching = self.match7[self.match7.node_id.isin(self.child_ids)]
child_matching = child_matching.drop(columns=['inc_angle', 'out_angle'])
@ -701,22 +714,19 @@ class DailyPreprocessor():
self.nodes = [self.net.getNode(node_id) for node_id in self.node_ids]
self.node2init = {}
# 모든 노드들을 순회
for node in self.nodes:
node_id = node.getID()
for node_id in self.node_ids:
node = self.net.getNode(node_id)
# 모든 connection
conns = [(c.getJunctionIndex(), c) for c in node.getConnections()]
conns = [c for c in conns if c[0] >= 0]
conns = sorted(conns, key=lambda x: x[0])
state = []
# i번째 connection : ci
for i, ci in conns:
for i, ci in conns: # i번째 connection : ci
if ci.getTLLinkIndex() < 0:
continue
are_foes = False
# j번째 connection : cj
# 합류지점이 다르면서 상충되는 cj가 존재하면 are_foes = True (r)
# 그외의 경우에는 are_foes = False (g)
for j, cj in conns:
# 합류지점이 다르면서 상충되는 cj가 존재하면 r, 그외에는 g
for j, cj in conns: # j번째 connection : cj
# ci, cj의 합류지점이 같으면 통과
if ci.getTo() == cj.getTo():
continue
@ -728,7 +738,7 @@ class DailyPreprocessor():
self.node2init[node_id] = state
# 어떤 연결과도 상충이 일어나지는 않지만, 신호가 부여되어 있는 경우에는 r을 부여
for _, row in self.matching.iterrows():
for _, row in self.match6.dropna(subset=['inc_edge_id', 'out_edge_id']).iterrows():
node_id = row.node_id
move_no = row.move_no
inc_edge_id = row.inc_edge_id
@ -830,19 +840,6 @@ class DailyPreprocessor():
self.matching.to_csv(os.path.join(self.path_intermediates, 'matching.csv'), index=0)
print('2-3. 직진 및 좌회전(G)을 배정했습니다.')
uid2uindex = {}
for uid in self.u_turn_ids:
states = self.match6[self.match6.node_id==uid].state.unique()
for state in states:
if 'G' in state:
index = state.index('G')
uid2uindex[uid] = index
break
# json 파일로 저장
with open(os.path.join(self.path_intermediates, 'uid2uindex.json'), 'w') as file:
json.dump(uid2uindex, file)
# 2-4 node2num_cycles : A dictionary that maps a node_id to the number of cycles
def get_node2num_cycles(self):
Aplan = self.plan.copy()[['inter_no'] + [f'dura_A{j}' for j in range(1,9)] + ['cycle']]

Loading…
Cancel
Save