00001 /* -*-C-*- 00002 ******************************************************************************** 00003 * 00004 * File: metrics.h (Formerly metrics.h) 00005 * Description: 00006 * Author: Mark Seaman, SW Productivity 00007 * Created: Fri Oct 16 14:37:00 1987 00008 * Modified: Tue Jul 30 17:02:48 1991 (Mark Seaman) marks@hpgrlt 00009 * Language: C 00010 * Package: N/A 00011 * Status: Reusable Software Component 00012 * 00013 * (c) Copyright 1987, Hewlett-Packard Company. 00014 ** Licensed under the Apache License, Version 2.0 (the "License"); 00015 ** you may not use this file except in compliance with the License. 00016 ** You may obtain a copy of the License at 00017 ** http://www.apache.org/licenses/LICENSE-2.0 00018 ** Unless required by applicable law or agreed to in writing, software 00019 ** distributed under the License is distributed on an "AS IS" BASIS, 00020 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00021 ** See the License for the specific language governing permissions and 00022 ** limitations under the License. 00023 * 00024 *********************************************************************************/ 00025 #ifndef METRICS_H 00026 #define METRICS_H 00027 00028 /*---------------------------------------------------------------------- 00029 I n c l u d e s 00030 ----------------------------------------------------------------------*/ 00031 #include "measure.h" 00032 #include "bestfirst.h" 00033 #include "states.h" 00034 00035 /*---------------------------------------------------------------------- 00036 V a r i a b l e s 00037 ----------------------------------------------------------------------*/ 00038 extern int words_chopped1; 00039 extern int words_chopped2; 00040 extern int chops_attempted1; 00041 extern int chops_performed1; 00042 extern int chops_attempted2; 00043 extern int chops_performed2; 00044 extern int permutation_count; 00045 00046 extern int character_count; 00047 extern int word_count; 00048 extern int chars_classified; 00049 00050 extern MEASUREMENT width_measure; 00051 extern MEASUREMENT width_priority_range; 00052 extern MEASUREMENT match_priority_range; 00053 00054 /*---------------------------------------------------------------------- 00055 F u n c t i o n s 00056 ----------------------------------------------------------------------*/ 00057 void init_metrics(); 00058 void end_metrics(); 00059 00060 void record_certainty(float certainty, int pass); 00061 00062 void record_search_status(int num_states, int before_best, float closeness); 00063 00064 void record_priorities(SEARCH_RECORD *the_search, 00065 FLOAT32 priority_1, 00066 FLOAT32 priority_2); 00067 00068 void record_samples(FLOAT32 match_pri, FLOAT32 width_pri); 00069 00070 void reset_width_tally(); 00071 00072 void save_best_state(CHUNKS_RECORD *chunks_record); 00073 00074 void start_recording(); 00075 00076 void stop_recording(); 00077 00078 /* 00079 #if defined(__STDC__) || defined(__cplusplus) || MAC_OR_DOS 00080 # define _ARGS(s) s 00081 #else 00082 # define _ARGS(s) () 00083 #endif*/ 00084 00085 /* metrics.c 00086 void init_metrics 00087 _ARGS((void)); 00088 00089 void record_certainty 00090 _ARGS((float certainty, 00091 int pass)); 00092 00093 void record_search_status 00094 _ARGS((int num_states, 00095 int before_best, 00096 float closeness)); 00097 00098 void save_summary 00099 _ARGS((inT32 elapsed_time)); 00100 00101 void record_priorities 00102 _ARGS((SEARCH_RECORD *the_search, 00103 STATE *old_state, 00104 FLOAT32 priority_1, 00105 FLOAT32 priority_2)); 00106 00107 void record_samples 00108 _ARGS((FLOAT32 match_pri, 00109 FLOAT32 width_pri)); 00110 00111 void reset_width_tally 00112 _ARGS((void)); 00113 00114 void save_best_state 00115 _ARGS((CHUNKS_RECORD *chunks_record)); 00116 00117 void start_recording 00118 _ARGS((void)); 00119 00120 void stop_recording 00121 _ARGS((void)); 00122 00123 #undef _ARGS 00124 */ 00125 #endif