* @param length The number of test steps to do.
* @param rand The random number generator used to choose paths.
*/
public void allRoundTrips(int length, Random rand)
{
CoverageMetric state = new StateCoverage();
this.addCoverageMetric(state);
int totalLength = 0;
doReset("Initial", true);
while (totalLength < length) {
int taken = doGreedyRandomActionOrReset(rand, true);
if (taken < 0) {
System.out.println("reset state coverage");
state.clear();
}
else {
totalLength++;
if (state.getDetails().get(getCurrentState()) > 1) {
doReset("found loop", true);
state.clear();
}
}
}
this.printProgress(1, "finished allRoundTrips of " + length
+ " transitions.");