34 lines
958 B
Python
34 lines
958 B
Python
|
|
import os
|
||
|
|
import subprocess
|
||
|
|
|
||
|
|
subprocess.run("rm *.toml", shell=True)
|
||
|
|
|
||
|
|
MOT_FOLDER = "mot/"
|
||
|
|
SIM_FOLDER = "sim/"
|
||
|
|
PID_FOLDER = "pid_cont/"
|
||
|
|
|
||
|
|
mot_files = os.listdir(MOT_FOLDER)
|
||
|
|
sim_files = os.listdir(SIM_FOLDER)
|
||
|
|
pid_files = os.listdir(PID_FOLDER)
|
||
|
|
|
||
|
|
prod: list[tuple[str, str, str]] = [
|
||
|
|
(y, x, z) for x in mot_files for y in sim_files for z in pid_files
|
||
|
|
]
|
||
|
|
|
||
|
|
for case in prod:
|
||
|
|
settings = ""
|
||
|
|
with open(SIM_FOLDER + case[0], "r") as f1:
|
||
|
|
with open(MOT_FOLDER + case[1], "r") as f2:
|
||
|
|
with open(PID_FOLDER + case[2], "r") as f3:
|
||
|
|
settings = f1.read() + "\n" + f2.read() + "\n" + f3.read()
|
||
|
|
with open(
|
||
|
|
"".join(case).replace(".toml", "_").removesuffix("_") + ".toml", "w"
|
||
|
|
) as f:
|
||
|
|
f.write(settings)
|
||
|
|
|
||
|
|
# cont = open(PID_FOLDER + "low_1.toml").read()
|
||
|
|
# for i in range(1, 11):
|
||
|
|
# num = 0.005 * i
|
||
|
|
# with open(PID_FOLDER + f"low_{i:02d}.toml", "w") as f:
|
||
|
|
# f.write(cont.replace("0.005", str(num)))
|