2024-02-05 23:11:26 -05:00
|
|
|
import math
|
2024-01-26 12:36:53 -05:00
|
|
|
import subprocess
|
|
|
|
import xmltodict
|
|
|
|
|
2024-01-26 15:11:49 -05:00
|
|
|
import geopandas as gpd
|
|
|
|
from shapely.geometry import Point
|
|
|
|
|
2024-01-26 12:36:53 -05:00
|
|
|
from matsim_activity_to_matsim_schedule import MatsimActivityToMatsimSchedule
|
|
|
|
from hub_function_to_matsim_activity import HubFunctionToMatsimActivity
|
|
|
|
|
|
|
|
class MatSimEngine:
|
2024-02-06 16:52:33 -05:00
|
|
|
def __init__(self, config_file_path):
|
|
|
|
self._config_file_path = config_file_path
|
2024-01-26 12:36:53 -05:00
|
|
|
|
|
|
|
def run(self):
|
|
|
|
java_path = "java"
|
|
|
|
jar_path = "matsim.jar"
|
|
|
|
command = [java_path, "-jar", jar_path]
|
|
|
|
|
|
|
|
# Must generate this config file first.
|
2024-02-06 16:52:33 -05:00
|
|
|
command.append(self._config_file_path)
|
2024-01-26 12:36:53 -05:00
|
|
|
|
2024-02-05 23:11:26 -05:00
|
|
|
subprocess.run(command)
|