f.write ("\t single operation time (min / avg / max):\n\t"+str(d[n+'_min'])+"\t"+str(d[n])+"\t"+str(d[n+'_max'])+"\t\n")
f.write ("\t total time (min / avg / max / % of total / % of total wtht path planning):\n\t"+str(d['total_'+n+'_min'])+"\t"+str(d['total_'+n])+"\t"+str(d['total_'+n+'_max'])+"\t"+str(float(d['total_'+n])/tTime*100)+"%"+"\t"+str(float(d['total_'+n])/g_time*100)+"%\n")
f.write ("\t number of tests (min / avg / max):\n\t"+str(d['minnum'+n])+"\t"+str(d['num'+n])+"\t"+str(d['maxnum'+n])+"\n")
f.write ("total computation time (min / avg / max): "+str(d['mingen_time']+d['min_path_time'])+"\t"+str(tTime)+"\t"+str(d['maxgen_time']+d['max_path_time'])+"\n")
f.write ("generation time (without RRT) (min / avg / max / % of total):\n\t"+str(d['mingen_time'])+"\t"+str(d['gen_time'])+"\t"+str(d['maxgen_time'])+"\t"+str(float(d['gen_time'])/tTime*100)+"%\n")
f.write ("path computation: \n")
f.write ("\t time (min / avg / max / % of total):\n\t"+str(d['min_path_time'])+"\t"+str(d['path_time'])+"\t"+str(d['max_path_time'])+"\t"+str(float(d['path_time'])/tTime*100)+"%\n")
forstatinstats:
printOneStat(f,stat,d,g_time,tTime)
f.write ("number of successes / failures / ratio: "+str(d['success'])+"\t"+str(d['failed'])+"\t"+str(float(d['success'])/float(d['success'])*100)+"%\n")
nc=float(d['no contact'])
c=float(d['contact'])
uc=float(d['unstable contact'])
tc=nc+c+uc
f.write ("% of failed contact generation (no candidates found): "+str(nc/tc*100)+"%\n")
f.write ("% of unstable contact generation (no balanced candidates found): "+str(uc/tc*100)+"%\n")