mirror of
https://github.com/Ahp06/SUMO_Emissions.git
synced 2024-11-24 20:46:29 +00:00
Changed some doc method
This commit is contained in:
parent
f00e933fe6
commit
6571b09d83
@ -5,7 +5,7 @@ Created on 19 janv. 2019
|
||||
'''
|
||||
|
||||
"""
|
||||
Init the Traci API
|
||||
This module defines the entry point of the application
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@ -26,7 +26,9 @@ from data import Data
|
||||
import emissions
|
||||
from model import Emission
|
||||
|
||||
|
||||
"""
|
||||
Init the Traci API
|
||||
"""
|
||||
if 'SUMO_HOME' in os.environ:
|
||||
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
|
||||
sys.path.append(tools)
|
||||
@ -36,6 +38,13 @@ else:
|
||||
class RunProcess(multiprocessing.Process):
|
||||
|
||||
def __init__(self, data : Data, config : Config, save_logs, csv_export):
|
||||
"""
|
||||
RunProcess constructor
|
||||
:param data: The data instance
|
||||
:param config: The config instance
|
||||
:param save_logs: If save_logs == True, it will save the logs into the logs directory
|
||||
:param csv_export: If csv_export == True, it will export all emissions data into a csv file
|
||||
"""
|
||||
multiprocessing.Process.__init__(self)
|
||||
self.data = data
|
||||
self.config = config
|
||||
@ -43,6 +52,9 @@ class RunProcess(multiprocessing.Process):
|
||||
self.csv_export = csv_export
|
||||
|
||||
def init_logger(self):
|
||||
"""
|
||||
Init logger properties
|
||||
"""
|
||||
now = datetime.datetime.now()
|
||||
current_date = now.strftime("%Y_%m_%d_%H_%M_%S")
|
||||
|
||||
@ -220,15 +232,11 @@ def main(args):
|
||||
process = []
|
||||
|
||||
if args.c is not None:
|
||||
for conf in args.c: # Initialize all process
|
||||
|
||||
# Init
|
||||
for conf in args.c:
|
||||
config = Config(conf,data)
|
||||
|
||||
p = RunProcess(data, config,args.save,args.csv)
|
||||
#p.init_logger()
|
||||
process.append(p)
|
||||
|
||||
p.start()
|
||||
|
||||
for p in process : p.join()
|
||||
|
Loading…
Reference in New Issue
Block a user