Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

logging/SOptCriterionLog.h

Go to the documentation of this file.
00001 /* #start# ***********************************************************
00002 
00003                              Scheduling Simulator
00004                     Lehrstuhl f"ur Effiziente Algorithmen
00005                        Technische Universit"at M"unchen
00006 
00007  File    : $Id: SOptCriterionLog.h,v 1.2 2002/11/10 20:32:20 taeubig Exp $
00008 
00009  Purpose : logs completion time of jobs and computes optimality criteria 
00010            in order to evaluate a schedule
00011 
00012  RCS-Log:
00013  $Log: SOptCriterionLog.h,v $
00014  Revision 1.2  2002/11/10 20:32:20  taeubig
00015  namespace and header include changes
00016 
00017  Revision 1.1  2002/08/29 12:59:58  taeubig
00018  Added the sources
00019 
00020  Revision 1.8  2000/05/24 12:34:32  taeubig
00021  New compiler (gcc-2.95) and new Qt (2.1)
00022  Replaced "list" by "leda_list" etc.
00023 
00024  Revision 1.7  2000/01/17 10:17:23  zoidl
00025  little changes in javadocs
00026 
00027  Revision 1.6  2000/01/11 19:44:45  zoidl
00028  reset gantt chart also on EDITEVENTs
00029 
00030  Revision 1.5  2000/01/11 12:55:13  zoidl
00031  added javadoc comments
00032 
00033  Revision 1.4  1999/12/28 13:04:45  zoidl
00034  *** empty log message ***
00035 
00036  Revision 1.3  1999/12/28 12:04:10  zoidl
00037  changed declaration of getValue back to original setting
00038 
00039  Revision 1.2  1999/12/27 10:07:02  kern
00040  changed getValue paramters from Criterion,Type,bool to int,int,bool
00041 
00042  Revision 1.1  1999/12/14 22:09:04  zoidl
00043  added logger for optimality criteria
00044 
00045 
00046  * #end# ************************************************************* */
00047 
00048 #ifndef SOPTCRITERIONLOG_H
00049 #define SOPTCRITERIONLOG_H
00050 
00051 // system header files
00052 
00053 // project header files
00054 #include "SLogger.h"
00055 
00064 class SOptCriterionLog : public virtual SLogger
00065 {
00066  public:
00067   
00070   enum Type { MAX, SUM, MEAN };
00071   
00075   enum Criterion {COMPLETION, FLOW, LATENESS, TARDINESS, 
00076       EARLINESS, NUMTARDYTASKS };
00077   
00083   SOptCriterionLog(STaskSystem& ts, bool registerAsObserver=true);
00084   
00087   ~SOptCriterionLog();
00088   
00093   virtual void feedEvent(const SEvent& event);    
00094 
00095   
00107   double getValue(Criterion crit, Type type=MAX, bool weighted=false) const;
00108 
00109   // for the lazy ones among us:
00114   double getMakeSpan() const 
00115     { return getValue(COMPLETION, MAX, false); };
00116 
00121   double getMeanFlowTime() const
00122     { return getValue(FLOW, MEAN, false); };
00123 
00128   double getMaxLateness() const
00129     { return getValue(LATENESS, MAX, false); };
00130 
00135   double getCompletionTime(int job) const
00136     { return _completion[job]; };
00137   
00142   void reset();
00143   
00144  private:
00145   // to get access to simTime
00146   STaskSystem& _rTaskSys;
00147   // stores the completion times of all jobs
00148   leda_array<double> _completion;
00149   // did we register as observer
00150   bool _regAsObserver;
00151   // to avoid to much resetting
00152   bool _isResetted;
00153 };
00154 
00155 #endif

Generated on Thu May 22 16:48:08 2003 for Sketch-it! by doxygen1.2.18