Added timing code

This commit is contained in:
Brandon Rozek 2024-03-29 17:33:51 -04:00
parent 13b3879630
commit f44c75e3a6
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480

View file

@ -50,6 +50,7 @@ public final class Runner {
for (PlanningProblem planningProblem : planningProblemList) {
long start = System.currentTimeMillis();
Set<Plan> plans = astarplanner.plan(
planningProblem.getBackground(),
planningProblem.getActions(),
@ -57,9 +58,11 @@ public final class Runner {
planningProblem.getGoal(),
ConstantHeuristic::h
);
long end = System.currentTimeMillis();
if(plans.size() > 0) {
System.out.println(plans.toString());
System.out.println("Time (ms): " + (end - start));
}
else {
System.out.println("FAILED");