Browse Source

Adapt some classes to use new ProgressDisplay.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@4947 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 14 years ago
parent
commit
d3dd8a7ac1
  1. 4
      prism/src/explicit/ConstructModel.java
  2. 26
      prism/src/pta/ForwardsReach.java

4
prism/src/explicit/ConstructModel.java

@ -136,7 +136,7 @@ public class ConstructModel
} }
// Starting reachability... // Starting reachability...
mainLog.print("\nComputing reachable states... ");
mainLog.print("\nComputing reachable states...");
mainLog.flush(); mainLog.flush();
ProgressDisplay progress = new ProgressDisplay(mainLog); ProgressDisplay progress = new ProgressDisplay(mainLog);
progress.start(); progress.start();
@ -250,7 +250,7 @@ public class ConstructModel
// Finish progress display // Finish progress display
progress.update(src + 1); progress.update(src + 1);
progress.end();
progress.end(" states");
// Reachability complete // Reachability complete
mainLog.print("Reachable states exploration" + (justReach ? "" : " and model construction")); mainLog.print("Reachable states exploration" + (justReach ? "" : " and model construction"));

26
prism/src/pta/ForwardsReach.java

@ -94,17 +94,18 @@ public class ForwardsReach
ReachabilityGraph graph; ReachabilityGraph graph;
int src, dest, count, dests[]; int src, dest, count, dests[];
boolean canDiverge; boolean canDiverge;
long timer, timerProgress;
boolean progressDisplayed;
long timer;
// Store target info // Store target info
this.targetLocs = targetLocs; this.targetLocs = targetLocs;
this.targetConstraint = targetConstraint; this.targetConstraint = targetConstraint;
// Starting reachability... // Starting reachability...
mainLog.println("\nBuilding forwards reachability graph...");
timer = timerProgress = System.currentTimeMillis();
progressDisplayed = false;
mainLog.print("\nBuilding forwards reachability graph...");
mainLog.flush();
ProgressDisplay progress = new ProgressDisplay(mainLog);
progress.start();
timer = System.currentTimeMillis();
// Re-compute max clock constraint value if required // Re-compute max clock constraint value if required
if (targetConstraint != null) if (targetConstraint != null)
@ -231,20 +232,13 @@ public class ForwardsReach
throw new PrismException(s); throw new PrismException(s);
} }
// Print some progress info occasionally // Print some progress info occasionally
if (System.currentTimeMillis() - timerProgress > 3000) {
if (!progressDisplayed) {
mainLog.print("Number of states so far:");
progressDisplayed = true;
}
mainLog.print(" " + Yset.size());
mainLog.flush();
timerProgress = System.currentTimeMillis();
}
if (progress.ready())
progress.update(Yset.size());
} }
// Tidy up progress display // Tidy up progress display
if (progressDisplayed)
mainLog.println(" " + Yset.size());
progress.update(Yset.size());
progress.end(" states");
// Convert state set to ArrayList and store // Convert state set to ArrayList and store
graph.states = Yset.toArrayList(); graph.states = Yset.toArrayList();

Loading…
Cancel
Save