next up previous contents
Next: Realizing accuracy goals Up: Gathering results with Previous: Samples and reports

The histogram class

The class histogram has the following interface :

   interface histogram
   {
      histogram(char* p,char* options = "");
      histogram(widget* w,char* p,char* options = "");
      virtual ~histogram();      
   
      void sample(double x,double y = 1);     // adds a sample
   
      ofstream* file(char* fn);         // write samples to fn
      void closefile(char* fn);         // write samples to fn

      void reset();                 // resets histogram
   
      double mean();                // return mean
      double variance();            // return variance
      double standarddeviation();   // return standard deviation
      double sumfrequencies();      // return sum of frequencies
      double minimum();             // return minimum value
      double maximum();             // return maximum value

      friend ostream& operator<<(ostream& os,histogram& h);
   };

The reset method resets a histogram as if nothing was recorded yet (by setting the internal data to its original state). The simulation, generator, resource and queue classes also contain this method. The use is made clear in the following section.



A Eliens
Tue Oct 31 09:27:21 MET 1995