1a92e325f4a2e9dbdb8284ff9c4ce19deb0bc932
5 solverpath
= "C:\\Users\\Alex Fedotov\\Documents\\Studies\\Model Checking\\Assignments\\Solver\\"
7 #paths to folders with sokoban screens
8 paths
= ["C:\\Users\\Alex Fedotov\\Documents\\Studies\\Model Checking\\Assignments\\Sokoban\\screens",
11 #path to output folder (base)
12 output
= "C:\\Users\\Alex Fedotov\\Documents\\Studies\\Test"
14 commands
= ["C:\\Users\\Alex Fedotov\\Documents\\Studies\\Model Checking\\Assignments\\Solver\\solver.exe"]
23 if not os
.path
.isdir(path
):
25 print("You specified a wrong path: %s" % path
)
28 def checkScreen(screenpath
):
31 with
open(screenpath
,"r") as src
:
33 scrSize
+= len(line
.rstrip())
34 scrBox
+= line
.count('$')
35 scrBox
+= line
.count('*')
37 return boxbound
>= scrBox
and sizebound
>= scrSize
41 out
= open(output
+ "\\results.txt", "w")
43 all_rs
= os
.listdir(path
)
45 input_path
= path
+ "\\" + test
46 os
.makedirs(output
, exist_ok
=True)
48 if checkScreen(input_path
):
50 runcommand
.append(com
)
51 runcommand
.append(input_path
)
53 proc
= subprocess
.run(runcommand
, stdout
=subprocess
.PIPE
, universal_newlines
=True)
55 out
.write(test
+ ":" + proc
.stdout
)
56 print(test
+ ":" + proc
.stdout
)
57 #input("Press enter to continue...")