From c22828dbb45de316216af775623f37dc1c5d5c35 Mon Sep 17 00:00:00 2001 From: govin08 Date: Fri, 12 Apr 2024 10:26:58 +0900 Subject: [PATCH] altered the location of the definition of node2inter and inter2node --- .../0411_unp-left.ipynb | 16 +- Results/sn_1704417600.add.xml | 752 +++++++++--------- Results/sn_1704417900.add.xml | 696 ++++++++-------- Scripts/preprocess_daily.py | 6 +- 4 files changed, 736 insertions(+), 734 deletions(-) diff --git a/Analysis/0411_unp-left_p-right-uturn/0411_unp-left.ipynb b/Analysis/0411_unp-left_p-right-uturn/0411_unp-left.ipynb index 3829fea41..2c9db6cd5 100644 --- a/Analysis/0411_unp-left_p-right-uturn/0411_unp-left.ipynb +++ b/Analysis/0411_unp-left_p-right-uturn/0411_unp-left.ipynb @@ -31,22 +31,22 @@ "\n", "필요한 객체들 목록\n", "\n", - "- `int2dire2rvec` : `inter_no` $\\mapsto$ `dire2rvec`\n", + "- `inter2dire2rvec` : `inter_no` $\\mapsto$ `dire2rvec`\n", " - `dire2rvec` : `dire` $\\mapsto$ `rvec`\n", - "- `int2incs` : `inter_no` $\\mapsto$ `inc_edge_ids`\n", - "- `int2outs` : `inter_no` $\\mapsto$ `out_edge_ids`\n", - "- `int2inc2dire` : `inter_no` $\\mapsto$ `int2dire`\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", - "- `int2out2dire` : `inter_no` $\\mapsto$ `out2dire`\n", + "- `inter2out2dire` : `inter_no` $\\mapsto$ `out2dire`\n", " - `out2dire` : `inc_edge_id` $\\mapsto$ `dire`\n", - "- `int2inc2vec` : `inter_no` $\\mapsto$ `int2vec`\n", + "- `inter2inc2vec` : `inter_no` $\\mapsto$ `int2vec`\n", " - `inc2vec` : `out_edge_id` $\\mapsto$ `vec`\n", - "- `int2out2vec` : `inter_no` $\\mapsto$ `out2vec`\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 = int2inc2vec[inter_no][inc_edge_id]` and `out_vec = int2out2vec[inter_no][out_edge_id]`.\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", diff --git a/Results/sn_1704417600.add.xml b/Results/sn_1704417600.add.xml index 828c38ba9..cdf2d488e 100644 --- a/Results/sn_1704417600.add.xml +++ b/Results/sn_1704417600.add.xml @@ -3,410 +3,410 @@ - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/Results/sn_1704417900.add.xml b/Results/sn_1704417900.add.xml index 5c09135db..79ae37893 100644 --- a/Results/sn_1704417900.add.xml +++ b/Results/sn_1704417900.add.xml @@ -45,368 +45,368 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/Scripts/preprocess_daily.py b/Scripts/preprocess_daily.py index 33c9eac0a..22ff71519 100644 --- a/Scripts/preprocess_daily.py +++ b/Scripts/preprocess_daily.py @@ -186,7 +186,6 @@ class DailyPreprocessor(): # 1-5. 주요 객체 (리스트, 딕셔너리) 저장 def restore_objects(self): - self.node2inter = dict(zip(self.inter_node['node_id'], self.inter_node['inter_no'])) self.parent_ids = sorted(self.inter_node[self.inter_node.inter_type=='parent'].node_id.unique()) self.child_ids = sorted(self.inter_node[self.inter_node.inter_type=='child'].node_id.unique()) self.uturn_ids = sorted(self.uturn.child_id.unique()) @@ -202,7 +201,10 @@ class DailyPreprocessor(): with open(os.path.join(self.path_intermediates, 'ids.json'), 'w') as file: json.dump(ids, file) - # parent node만 가져옴. + # node2inter : node_id to inter_no + self.node2inter = dict(zip(self.inter_node['node_id'], self.inter_node['inter_no'])) + + # inter2node : inter_no to node_id inter_node1 = self.inter_node[self.inter_node.inter_type == 'parent'].drop('inter_type', axis=1) inter_info1 = self.inter_info[['inter_no', 'inter_lat', 'inter_lon']] inter = pd.merge(inter_node1, inter_info1, how='left', left_on=['inter_no'],