* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException
{
final int experiments = 100;
TimedModel model = new TimedModel(new SimpleTimedLight());
Tester tester = new RandomTester(model);
//tester.addListener(new VerboseListener());
double origProb = model.getTimeoutProbability();
model.setTimeoutProbability(0.3); // while exploring the FSM
GraphListener graph = tester.buildGraph();
model.setTimeoutProbability(origProb);
graph.printGraphDot("SimpleTimedLight.dot");
System.out.println("FSM has " + graph.getGraph().numVertices() + " states and "
+ graph.getGraph().numEdges() + " transitions");
CoverageMetric metric = tester.addCoverageMetric(new TransitionCoverage());
for (double prob = 0.1; prob < 0.99; prob += 0.1) {
model.setTimeoutProbability(prob);
double totalSteps = 0.0;
int totalTime = 0; // sum of all the totalTimes.
for (int seed = 0; seed < experiments; seed++) {
int testSeqTime = 0;
int lastTime = 0; // the time after the last transition
metric.clear();
tester.reset();
tester.setRandom(new Random(seed));
int count = 0;
while (metric.getPercentage() < 100.0) {
tester.generate(1);
if (model.getTime() > lastTime) {
lastTime = model.getTime();
} else {
testSeqTime += lastTime;
//System.out.println("added " + lastTime + " secs");
lastTime = 0;
}