Print plan statistics only if plan found

This commit is contained in:
Patrick Lühne 2018-01-26 18:46:42 +01:00
parent 704fbcf130
commit a9ee64ed81
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

25
main.c
View File

@ -222,18 +222,27 @@ void printStatistics()
break;
}
const auto planLength = seqs[solutionIndex].sati->nOfTPoints - 1;
printf("plan:\n found: ");
int numberOfActions = 0;
if (solutionIndex < 0)
printf("false\n");
else
{
printf("true\n");
const satinstance sati = seqs[solutionIndex].sati;
const auto planLength = seqs[solutionIndex].sati->nOfTPoints - 1;
for (int t = 0; t < sati->nOfTPoints - 1; t++)
for (int i = 0; i < sati->nOfActions; i++)
if (vartruep(sati,TACT(i,t)))
numberOfActions++;
int numberOfActions = 0;
printf("plan:\n length: %i\n actions: %i\n", planLength, numberOfActions);
const satinstance sati = seqs[solutionIndex].sati;
for (int t = 0; t < sati->nOfTPoints - 1; t++)
for (int i = 0; i < sati->nOfActions; i++)
if (vartruep(sati,TACT(i,t)))
numberOfActions++;
printf(" length: %i\n actions: %i\n", planLength, numberOfActions);
}
if(flagOutputDIMACS == 0) {
printf("iterations:\n");