From 7d021b17a43ede187463b63e93814f320b355c1e Mon Sep 17 00:00:00 2001 From: govin08 Date: Wed, 17 Apr 2024 16:08:59 +0900 Subject: [PATCH] rename u_turn to uturn in preprocess_daily --- .../0417_generate_signals.ipynb | 24 +- Results/sn_1704416700.add.xml | 1014 +++++++++-------- Scripts/preprocess_daily.py | 24 +- 3 files changed, 573 insertions(+), 489 deletions(-) diff --git a/Analysis/0411_unp-left_p-right-uturn/0417_generate_signals.ipynb b/Analysis/0411_unp-left_p-right-uturn/0417_generate_signals.ipynb index 8f0346ba2..e402ec41a 100644 --- a/Analysis/0411_unp-left_p-right-uturn/0417_generate_signals.ipynb +++ b/Analysis/0411_unp-left_p-right-uturn/0417_generate_signals.ipynb @@ -45,7 +45,27 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['u00', 'u20', 'u30', 'u31', 'u32', 'u60']" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "self.uturn_ids" + ] + }, + { + "cell_type": "code", + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -260,7 +280,7 @@ "[392 rows x 10 columns]" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } diff --git a/Results/sn_1704416700.add.xml b/Results/sn_1704416700.add.xml index c31d60aa2..b24fd1de3 100644 --- a/Results/sn_1704416700.add.xml +++ b/Results/sn_1704416700.add.xml @@ -1,123 +1,123 @@ - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -138,424 +138,488 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + - + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - + - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Scripts/preprocess_daily.py b/Scripts/preprocess_daily.py index bb5d60af2..8c8a0ad16 100644 --- a/Scripts/preprocess_daily.py +++ b/Scripts/preprocess_daily.py @@ -59,7 +59,7 @@ class DailyPreprocessor(): self.angle = pd.read_csv(os.path.join(self.path_tables, 'angle.csv'), dtype=loading_dtype) self.plan = pd.read_csv(os.path.join(self.path_tables, 'plan.csv'), dtype=loading_dtype) self.inter_node = pd.read_csv(os.path.join(self.path_tables, 'inter_node.csv'), dtype=loading_dtype) - self.u_turn = pd.read_csv(os.path.join(self.path_tables, 'uturn.csv'), dtype=loading_dtype) + self.uturn = pd.read_csv(os.path.join(self.path_tables, 'uturn.csv'), dtype=loading_dtype) self.u_condition= pd.read_csv(os.path.join(self.path_tables, 'u_condition.csv'), dtype=loading_dtype) self.coord = pd.read_csv(os.path.join(self.path_tables, 'child_coord.csv'), dtype=loading_dtype) self.nema = pd.read_csv(os.path.join(self.path_tables, 'nema.csv'), encoding='cp949', dtype=loading_dtype) @@ -190,7 +190,7 @@ class DailyPreprocessor(): def restore_objects(self): 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.u_turn_ids = sorted(self.u_turn.child_id.unique()) + self.uturn_ids = sorted(self.uturn.child_id.unique()) self.coord_ids = sorted(self.coord.child_id.unique()) # node2inter : node_id to inter_no @@ -216,7 +216,7 @@ class DailyPreprocessor(): ids = {'node_ids' : self.node_ids, 'parent_ids': self.parent_ids, 'child_ids' : self.child_ids, - 'uturn_ids' : self.u_turn_ids, + 'uturn_ids' : self.uturn_ids, 'coord_ids' : self.coord_ids, 'inter_nos' : self.inter_nos} with open(os.path.join(self.path_intermediates, 'ids.json'), 'w') as file: @@ -410,7 +410,7 @@ 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') + self.uturn = pd.merge(self.uturn, self.u_condition, on='child_id') # p2inc_edge2angle : node_id to inc_edge2angle p2inc_edge2angle = dict() @@ -438,7 +438,7 @@ class DailyPreprocessor(): # 각 uturn node에 대하여 (inc_edge_id, out_edge_id) 부여 cmatches = [] - for row in self.u_turn.itertuples(): + for row in self.uturn.itertuples(): parent_id = row.parent_id child_id = row.child_id condition = row.condition @@ -683,7 +683,7 @@ class DailyPreprocessor(): self.nodes = [self.net.getNode(node_id) for node_id in self.node_ids] self.node2init = {} # 유턴노드를 제외한 모든 노드 (우회전, 삼지교차로직진 : g, 그외 : r) - for node_id in sorted(set(self.node_ids) - set(self.u_turn_ids)): + for node_id in sorted(set(self.node_ids) - set(self.uturn_ids)): node = self.net.getNode(node_id) conns = [(c.getJunctionIndex(), c) for c in node.getConnections()] conns = [c for c in conns if c[0] >= 0] @@ -706,7 +706,7 @@ class DailyPreprocessor(): self.node2init[node_id] = state # 유턴노드 (유턴x : G, 유턴 : G) - for node_id in self.u_turn_ids: + for node_id in self.uturn_ids: node = self.net.getNode(node_id) conns = [(c.getJunctionIndex(), c) for c in node.getConnections()] conns = [c for c in conns if c[0] >= 0] @@ -737,16 +737,16 @@ class DailyPreprocessor(): # 2-3 유턴 인덱스 / 비보호좌회전 인덱스 지정 def assign_indices(self): - self.u2uindex = dict() # u_turn node id to u_turn index - for row in self.u_turn.itertuples(): + self.u2uindex = dict() # uturn node id to uturn index + for row in self.uturn.itertuples(): child_id = row.child_id inc_edge_id = row.inc_edge_id out_edge_id = row.out_edge_id # self.u2uindex 지정 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.u2uindex[child_id] = u_turn_conn.getTLLinkIndex() + uturn_conn = inc_edge.getConnections(out_edge)[0] + self.u2uindex[child_id] = uturn_conn.getTLLinkIndex() self.p2UPLindices2inc_edge_ids = dict() # parent id to unprotected left index for parent_id in self.parent_ids: @@ -845,7 +845,7 @@ class DailyPreprocessor(): 이 연결의 진입엣지(inc_edge_id : {inc_edge_id})에 부여된 신호가 없습니다.") # mactch6 : 유턴 신호가 한번도 배정되지 않은 경우에 대해서는 유턴이동류의 신호를 항상 g로 배정 - for node_id in self.u_turn_ids: + for node_id in self.uturn_ids: m6 = self.match6[self.match6.node_id==node_id] if not len(m6): continue