Skip to content
Snippets Groups Projects
Commit 48b30509 authored by Hans-Jörg's avatar Hans-Jörg
Browse files

Small bugfixes

parent 8ca08edc
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ class GridTPT:
def _parse_result(self, exp):
results = {}
strategy = None
with exp.open() as f:
for line in f:
m = re.match(self.__data_re, line)
......@@ -60,10 +61,11 @@ class GridTPT:
continue
m = re.match(self.__options_re, line)
if m:
print(m.group(1))
strategy = m.group(1)
continue
if not strategy:
if strategy is None:
raise ValueError("Could not parse strategy.")
if len(results) == 0:
raise ValueError("Could not get any solved benchmarks.")
......
......@@ -129,8 +129,11 @@ def writeScript(outFile, logics, schedule, seconds=False):
af.write(f" {logics[0]})\n")
else:
af.write(f" {logics})\n")
optimizer = OptimizeOrder(r.frame)
(_, time, solved) = optimizer.runtime(schedule)
num_solved = solved.sum()
af.write(
f" # Prediction: {after_count}/{after_solved.count()} in {after_total_time:.2f}s\n"
f" # Prediction: {num_solved}/{solved.count()} in {time:.2f}s\n"
)
for i in range(len(schedule) - 1):
(t, e) = schedule[i]
......@@ -216,7 +219,7 @@ if __name__ == "__main__":
r = GridTPT(args.data)
else:
r = GridTPT(args.data, logics)
exps = r.frame
exps = r.frame.copy()
pre_schedule = None
if args.pre_schedule:
......@@ -282,7 +285,7 @@ if __name__ == "__main__":
exit(1)
if new_count == best_count and time < best_time:
best_time = time
best_opt = e.options
best_opt = e
message("The best schedule is:", logics)
message(f" Run\t'{best_opt}'", logics)
message(f"This solves {best_count} in {best_time}s.", logics)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment