Add more statistics

This adds the following statistics: the number of state variables before
and after preprocessing, the number of ground actions before and after
preprocessing, and the maximum size of a strongly connected component.
This commit is contained in:
Patrick Lühne 2018-01-31 17:24:06 +01:00
parent f0b59029d1
commit 6c25431873
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

27
main.c
View File

@ -35,6 +35,14 @@
#include <omp.h> #include <omp.h>
#endif #endif
int numberOfGroundActionsAfterParsing = -1;
int numberOfStateVariablesAfterParsing = -1;
int numberOfGroundActionsAfterSimplification = -1;
int numberOfStateVariablesAfterSimplification = -1;
int maxSizeOfStronglyConnectedComponents = -1;
char state_for_random[256]; char state_for_random[256];
char dump_for_random[256]; char dump_for_random[256];
@ -211,6 +219,18 @@ void printStatistics()
printf("maxLearnedClauseLength: %i\n",stats_longest_learned); printf("maxLearnedClauseLength: %i\n",stats_longest_learned);
if (numberOfGroundActionsAfterParsing > -1)
printf("groundActions:\n afterParsing: %i\n",numberOfGroundActionsAfterParsing);
if (numberOfGroundActionsAfterSimplification > -1)
printf(" afterPreprocessing: %i\n",numberOfGroundActionsAfterSimplification);
if (numberOfStateVariablesAfterParsing > -1)
printf("stateVariables:\n afterParsing: %i\n",numberOfStateVariablesAfterParsing);
if (numberOfStateVariablesAfterSimplification > -1)
printf(" afterPreprocessing: %i\n",numberOfStateVariablesAfterSimplification);
if (maxSizeOfStronglyConnectedComponents > -1)
printf("stronglyConnectedComponents:\n maxSize: %i\n",maxSizeOfStronglyConnectedComponents);
int solutionIndex = -1; int solutionIndex = -1;
for (int i = 0; seqs[i].sati; i++) for (int i = 0; seqs[i].sati; i++)
@ -718,6 +738,9 @@ int main(int argc,char **argv) {
NEWgroundoperators(); NEWgroundoperators();
numberOfGroundActionsAfterParsing = nOfActions;
numberOfStateVariablesAfterParsing = nOfAtoms;
printf("Parser: %i ground actions and %i state variables\n",nOfActions,nOfAtoms); printf("Parser: %i ground actions and %i state variables\n",nOfActions,nOfAtoms);
if(flagShowInput) { if(flagShowInput) {
@ -754,6 +777,9 @@ int main(int argc,char **argv) {
if(flagEliminateConverses) mergecontras(); if(flagEliminateConverses) mergecontras();
numberOfGroundActionsAfterSimplification = nOfActions;
numberOfStateVariablesAfterSimplification = nOfAtoms;
printf("Simplified: %i ground actions and %i state variables\n",nOfActions,nOfAtoms); printf("Simplified: %i ground actions and %i state variables\n",nOfActions,nOfAtoms);
sortactions(); sortactions();
@ -786,6 +812,7 @@ int main(int argc,char **argv) {
int maxsize; int maxsize;
TIMEdisabling = time10ms(); TIMEdisabling = time10ms();
maxsize = scc(nOfActions); maxsize = scc(nOfActions);
maxSizeOfStronglyConnectedComponents = maxsize;
printf(" %.2f secs (max SCC size %i)\n",time2real(time10ms() - TIMEdisabling),maxsize); printf(" %.2f secs (max SCC size %i)\n",time2real(time10ms() - TIMEdisabling),maxsize);
} }