public void WriteAsYAML(System.CodeDom.Compiler.IndentedTextWriter TW) { double total = (ConstraintSetsReduced + ConstraintSetsLeftUnchanged); double reduceP = 100 * ((float)ConstraintSetsReduced) / total; double sameP = 100 * ((float)ConstraintSetsLeftUnchanged) / total; TW.WriteLine("{0}:", this.GetType().ToString()); TW.Indent += 1; TW.WriteLine("constraint_sets_reduced: {0} #({1}%)", ConstraintSetsReduced, reduceP); TW.WriteLine("constraint_sets_left_unchanged: {0} #({1}%)", ConstraintSetsLeftUnchanged, sameP); TW.WriteLine("constraint_set_reduction_time: {0}", TimeUsedToComputeReducedConstraintSet.TotalSeconds); TW.WriteLine("underlying_solver:"); TW.Indent += 1; UnderlyingSolverStats.WriteAsYAML(TW); TW.Indent -= 2; }
public void WriteAsYAML(System.CodeDom.Compiler.IndentedTextWriter TW) { double denominator = (double)(cacheHits + cacheMisses); if (denominator == 0) { denominator = 1; } double hitsPercentage = 100 * ((double)(cacheHits)) / denominator; double missesPercentage = 100 * ((double)cacheHits) / denominator; TW.WriteLine("{0}:", this.GetType().ToString()); TW.Indent += 1; TW.WriteLine("cache_hits: {0} #({1}%)", cacheHits, hitsPercentage); TW.WriteLine("cache_misses: {0} #({1}%)", cacheMisses, missesPercentage); TW.WriteLine("max_cache_size: {0}", maxCacheSize); TW.WriteLine("current_cache_size: {0}", currentCacheSize); TW.WriteLine("underlying_solver:"); TW.Indent += 1; UnderlyingSolverStats.WriteAsYAML(TW); TW.Indent -= 2; }