Go to the documentation of this file.
21 void InitAverages( unsigned int m, boolean useCharts, boolean useSamples,
76 unsigned int nc, unsigned int ns,
82 Error( "More succesful experiments than maximum experiments");
84 fprintf(stderr, "Data about the execution:\n");
86 fprintf(stderr, " Elapsed time: %f sec\n",t);
88 m=((double)mem)/(1024.0*1024.0);
90 fprintf(stderr, " Used memory : %f Mb\n",m);
93 fprintf(stderr, " Path length : %f\n",pl);
96 fprintf(stderr, " Path cost : %f\n",pc);
102 fprintf(stderr, " Num charts : %u\n",nc);
108 fprintf(stderr, " Num samples : %u\n",ns);
113 if ((time==NULL)||(cost==NULL))
130 for(i=0;i<av-> maxIt;i++)
132 av-> time[i]+=time[i];
133 av-> timeStd[i]+=(time[i]*time[i]);
138 av-> cost[i]+=cost[i];
139 av-> costStd[i]+=(cost[i]*cost[i]);
156 fprintf(f, "\n\n%% **************************************************\n");
158 gethostname(hostname,50);
160 fprintf(f, "Date : %s",ctime(&t));
161 fprintf(f, "Machine : %s\n",hostname);
162 fprintf(f, "Path : %s\n",path);
164 fprintf(f, "Command line: ");
166 fprintf(f, "%s ",arg[i]);
172 fprintf(f, "%% **************************************************\n");
173 fprintf(f, "Execution averages over %u repetitions\n",av-> maxExperiments);
185 fprintf(f, "****************************************************\n");
186 fprintf(f, "It Mean_time Std_time Mean_cost Std_cost N_cost\n");
189 for (i=0;i<av-> maxIt;i++)
200 for (i=0;i<av-> maxIt;i++)
208 for (i=0;i<av-> maxIt;i++)
212 fprintf(f, "%u %g %g ",i,av-> time[i],av-> timeStd[i]);
214 fprintf(stderr, "0 0 0\n");
219 fprintf(f, "**************************************************\n");
224 fprintf(f, " Time (CPU sec) \n");
225 fprintf(f, " Mean : %g\n",mt);
229 fprintf(f, " Memory (Mb) \n");
230 fprintf(f, " Mean : %g\n",mt);
234 fprintf(f, " Path length\n");
235 fprintf(f, " Mean : %g\n",ml);
239 fprintf(f, " Path Cost\n");
240 fprintf(f, " Mean : %g\n",ml);
246 fprintf(f, " Charts\n");
247 fprintf(f, " Mean : %g\n",mc);
254 fprintf(f, " Samples\n");
255 fprintf(f, " Mean : %g\n",ms);
260 fprintf(f, " Not enough successes to generate statistics\n");
#define NEW(_var, _n, _type) Allocates memory space.
void NewSuccesfulExperiment(double t, unsigned int mem, double pl, double pc, unsigned int nc, unsigned int ns, double *time, double *cost, Taverages *av) Adds data of a new experiment.
#define ITERATIONS_BETWEEN_DATA Iterations between printed data on time/cost.
void Error(const char *s) General error function.
Error and warning functions.
void PrintAverages(FILE *f, Taverages *av) Prints the averages of a set of experiments.
void PrintAveragesHeader(FILE *f, int argc, char **arg, Taverages *av) Prints a header to the averages results.
Definitions of constants and macros used in several parts of the cuik library.
Auxiliary functions to deal averages of path planner executions.
double StdDev(unsigned int s, double m, double *v) Computes the standard deviation.
#define NO_UINT Used to denote an identifier that has not been initialized.
Structure to store expeeriment results.
void DeleteAverages(Taverages *av) Deletes the space used by a set of averages.
unsigned int maxExperiments
void InitAverages(unsigned int m, boolean useCharts, boolean useSamples, unsigned int maxIt, Taverages *av) Initializes a set of averages.
double Mean(unsigned int s, double *v) Computes the mean.
|
Follow us!