Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

statistics.h

Go to the documentation of this file.
00001 #ifndef STATISTICSH
00002 #define STATISTICSH
00003 
00004 #include "boolean.h"
00005 
00006 #include <time.h>
00007 #include <sys/times.h>
00008 #include <stdio.h>
00009 
00010 
00028 typedef struct { 
00029 
00030   double t_init; 
00033   unsigned int np; 
00035   double volume; 
00036   double s_volume; 
00037   double s_diagonal;   
00039   unsigned int n_max_level;             
00041   unsigned int n_processed_boxes;       
00042   unsigned int n_solution_boxes;        
00043   unsigned int n_validated_solution_boxes; 
00044   unsigned int n_empty_boxes;           
00045   unsigned int n_splitted_boxes;        
00047   unsigned int n_lost_boxes;            
00049   unsigned int n_box_reductions;        
00051   unsigned int n_errors;                
00052 } Tstatistics;
00053 
00063 void InitStatistics(unsigned int np,double v,Tstatistics *t);
00064 
00073 void CopyStatistics(Tstatistics *t_dst,Tstatistics *t_src);
00074 
00085 double GetTime(Tstatistics *t);
00086 
00096 double GetElapsedTime(Tstatistics *t);
00097 
00107 double GetInitialTime(Tstatistics *t);
00108 
00109 
00118 void SetInitialTime(double tm,Tstatistics *t);
00119 
00129 void NewMaxLevel(unsigned int m,Tstatistics *t);
00130 
00138 void NewBoxProcessed(Tstatistics *t);
00139 
00150 void NewSolutionBox(boolean validated,double v,double d,Tstatistics *t);
00151 
00159 void NewEmptyBox(Tstatistics *t);
00160 
00168 void NewSplittedBox(Tstatistics *t);
00169 
00177 void NewRBError(Tstatistics *t);
00178 
00186 void NewLostBox(Tstatistics *t);
00187 
00195 void NewBoxReduction(Tstatistics *t);
00196 
00206 unsigned int GetNBoxReductions(Tstatistics *t);
00207 
00217 unsigned int GetNSolutionBoxes(Tstatistics *t);
00218 
00226 void ResetNBoxReductions(Tstatistics *t);
00227 
00236 void AddNBoxReductions(unsigned int nr,Tstatistics *t);
00237 
00248 void PrintStatistics(FILE *f,Tstatistics *t);
00249 
00259 void SaveStatistics(FILE *f,Tstatistics *t);
00260 
00270 void LoadStatistics(FILE *f,Tstatistics *t);
00271 
00279 void DeleteStatistics(Tstatistics *t);
00280 
00281 #endif