|
|
@ -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()) |
|
|
|