00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef SOPTCRITERIONLOG_H
00049 #define SOPTCRITERIONLOG_H
00050
00051
00052
00053
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
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
00146 STaskSystem& _rTaskSys;
00147
00148 leda_array<double> _completion;
00149
00150 bool _regAsObserver;
00151
00152 bool _isResetted;
00153 };
00154
00155 #endif