{ "cells": [ { "cell_type": "code", "execution_count": 2, "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", "- `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", "- `i2dire2rvec` : `inter_no` $\\mapsto$ `dire2rvec`\n", " - `dire2rvec` : `dire` $\\mapsto$ `rvec`\n", "- `i2f` : `inter_no` $\\mapsto$ `f_edges`\n", "- `i2t` : `inter_no` $\\mapsto$ `t_edges`\n", "- `i2f2dire` : `inter_no` $\\mapsto$ `f21dire`\n", " - `f2dire` : `from_edge` $\\mapsto$ `dire`\n", "- `i2t2dire` : `inter_no` $\\mapsto$ `t21dire`\n", " - `t2dire` : `to_edge` $\\mapsto$ `dire`" ] }, { "cell_type": "code", "execution_count": 3, "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", "2. 중간산출물을 생성합니다.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "이동류정보 불러오는 중: 100%|██████████| 17280/17280 [00:14<00:00, 1185.13it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "2-1. 매칭 테이블들을 생성했습니다.\n", "2-2. 비보호우회전(g)을 배정했습니다.\n", "2-3. 직진 및 좌회전(G)을 배정했습니다.\n", "2-2. node2num_cycles.json를 저장했습니다.\n", "3. 이슈사항을 저장합니다.\n" ] } ], "source": [ "self = DailyPreprocessor()\n", "self.main()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
inter_nophase_noring_typemove_noinc_dirout_dirinc_angleout_angle
01751A8179179
11751B4001001
21752A7001001
31752B3179179
41753A6090090
\n", "
" ], "text/plain": [ " inter_no phase_no ring_type move_no inc_dir out_dir inc_angle out_angle\n", "0 175 1 A 8 남 북 179 179\n", "1 175 1 B 4 북 남 001 001\n", "2 175 2 A 7 북 동 001 001\n", "3 175 2 B 3 남 서 179 179\n", "4 175 3 A 6 동 서 090 090" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
inter_nophase_noring_typemove_noinc_dirout_dirinc_angleout_angleinc_edgeout_edgenode_id
01751A8179179-571542797_02571542797_02i0
11751B4001001-571500487_01571500487_01i0
21752A7001001-571500487_01571500487_01i0
31752B3179179-571542797_02571542797_02i0
41753A6090090571545870_02571545870_01i0
\n", "
" ], "text/plain": [ " inter_no phase_no ring_type move_no inc_dir out_dir inc_angle out_angle \\\n", "0 175 1 A 8 남 북 179 179 \n", "1 175 1 B 4 북 남 001 001 \n", "2 175 2 A 7 북 동 001 001 \n", "3 175 2 B 3 남 서 179 179 \n", "4 175 3 A 6 동 서 090 090 \n", "\n", " inc_edge out_edge node_id \n", "0 -571542797_02 571542797_02 i0 \n", "1 -571500487_01 571500487_01 i0 \n", "2 -571500487_01 571500487_01 i0 \n", "3 -571542797_02 571542797_02 i0 \n", "4 571545870_02 571545870_01 i0 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display(self.match4.head())\n", "display(self.match5.head())" ] } ], "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 }