2024-01-26 12:36:53 -05:00
|
|
|
import subprocess
|
|
|
|
|
|
|
|
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-14 14:27:10 -05:00
|
|
|
subprocess.run(command, check=True)
|