Browse Source

start reviewing the entire codes. added testbed.net.xml. restore -> store

master
김선중 1 year ago
parent
commit
0f58ab0df2
4 changed files with 35680 additions and 3 deletions
  1. +71
    -0
      Analysis/0603_review_codes/0603_review_codes.ipynb
  2. +35605
    -0
      Data/networks/testbed.net.xml
  3. BIN
      Scripts/__pycache__/preprocess_daily.cpython-38.pyc
  4. +4
    -3
      Scripts/preprocess_daily.py

+ 71
- 0
Analysis/0603_review_codes/0603_review_codes.ipynb View File

@ -0,0 +1,71 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"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": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from preprocess_daily import DailyPreprocessor\n",
"\n",
"dp = DailyPreprocessor()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'c:\\\\Github\\\\snits_siggen\\\\Data\\\\tables'"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dp.path_tables"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ta",
"language": "python",
"name": "python3"
},
"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
}

+ 35605
- 0
Data/networks/testbed.net.xml
File diff suppressed because it is too large
View File


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


+ 4
- 3
Scripts/preprocess_daily.py View File

@ -7,11 +7,12 @@ import sumolib, traci
from tqdm import tqdm
class DailyPreprocessor():
def __init__(self):
def __init__(self, Path=None):
# 루트폴더 지정
self.path_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
with open(os.path.join(self.path_root, 'Scripts', 'config.json'), 'r') as config_file:
config = json.load(config_file)
# 주요 폴더 경로 지정
self.paths = config['paths']
self.path_data = os.path.join(self.path_root, *self.paths['data'])
@ -31,7 +32,7 @@ class DailyPreprocessor():
self.load_tables()
self.check_networks()
self.check_tables()
self.restore_objects()
self.store_objects()
# 1-1. 네트워크 불러오기
def load_networks(self):
@ -187,7 +188,7 @@ class DailyPreprocessor():
self.issues.append(msg)
# 1-5. 주요 객체 (리스트, 딕셔너리) 저장
def restore_objects(self):
def store_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.uturn_ids = sorted(self.uturn.child_id.unique())

Loading…
Cancel
Save