Properly time computations of accepting runs in randtgba.

* tests/core/randtgba.cc: do not time statistics.
This commit is contained in:
Maximilien Colange 2016-12-01 10:49:18 +01:00
parent 2b07326217
commit 9a1e411502

View file

@ -987,19 +987,25 @@ main(int argc, char** argv)
if (opt_replay) if (opt_replay)
{ {
spot::twa_run_ptr run; spot::twa_run_ptr run;
bool done = false;
tm_ar.start(algo); tm_ar.start(algo);
for (int count = opt_R;;) for (int count = opt_R;;)
{ {
run = res->accepting_run(); run = res->accepting_run();
if (count-- <= 0 || !run)
break;
}
if (!run)
tm_ar.cancel(algo);
else
tm_ar.stop(algo);
const spot::unsigned_statistics* s const spot::unsigned_statistics* s
= res->statistics(); = res->statistics();
if (opt_z && !done) if (opt_z)
{ {
// Count only the first run (the // Count only the last run (the
// other way would be to divide // other way would be to divide
// the stats by opt_R). // the stats by opt_R).
done = true;
sc_arc.count(algo, s); sc_arc.count(algo, s);
arc_ratio_stats.count(algo, s); arc_ratio_stats.count(algo, s);
} }
@ -1010,21 +1016,14 @@ main(int argc, char** argv)
<< "accepting runs," << "accepting runs,"
<< " halting... "; << " halting... ";
opt_ec = n_alg = opt_F = 0; opt_ec = n_alg = opt_F = 0;
break;
}
if (count-- <= 0 || !run)
break;
} }
if (!run) if (!run)
{ {
tm_ar.cancel(algo);
if (!opt_paper) if (!opt_paper)
std::cout << " exists, not computed"; std::cout << " exists, not computed";
} }
else else
{ {
tm_ar.stop(algo);
std::ostringstream s; std::ostringstream s;
if (!run->replay(s)) if (!run->replay(s))
{ {