00001 /* #start# *********************************************************** 00002 00003 Scheduling Simulator 00004 Lehrstuhl f"ur Effiziente Algorithmen 00005 Technische Universit"at M"unchen 00006 00007 File : $Id: SRTP.h,v 1.4 2003/01/08 18:57:11 meierb Exp $ 00008 00009 Purpose : Scheduling with Rejection (single processor tasks) 00010 00011 RCS-Log: 00012 $Log: SRTP.h,v $ 00013 Revision 1.4 2003/01/08 18:57:11 meierb 00014 added randomized release times 00015 00016 Revision 1.1.1.1 2002/12/02 22:26:19 meierb 00017 my_schedule 00018 00019 Revision 1.2 2002/11/10 13:32:52 taeubig 00020 namespace and header include changes 00021 00022 Revision 1.1 2002/08/29 12:59:58 taeubig 00023 Added the sources 00024 00025 Revision 1.1 2000/07/11 01:36:26 taeubig 00026 Added the REJECT-TOTAL-PENALTY(alpha) algorithm (RTP) 00027 for Scheduling with Rejection 00028 00029 00030 * #end# ************************************************************* */ 00031 00032 #ifndef SRTP_H 00033 #define SRTP_H 00034 00035 // system header files 00036 #include <cmath> 00037 #include <LEDA/string.h> 00038 00039 // project header files 00040 #include "SSchedAlgorithm.h" 00041 00042 class SRTP : public SSchedAlgorithm { 00043 public: 00044 SRTP() { 00045 _phi = ( 1.0 + std::sqrt(5.0) ) / 2.0; 00046 _alpha = _phi - 1.0; 00047 }; 00048 virtual ~SRTP() {}; 00049 virtual void startup(); 00050 virtual double innerLoop(const leda_list<STSysSchedEvent>& rEvents); 00051 virtual const leda_string getDescription() const; 00052 virtual const leda_string &getName() const; 00053 virtual const SClassification &getClassification() const; 00054 virtual SLeaBibEntry &getLeaBibEntry() const; 00055 00056 private: 00057 leda_array< leda_list<SJob*> > _scheduledJobs; 00058 double _penalty, _W; 00059 00060 double _phi; 00061 double _alpha; 00062 }; 00063 00064 #endif //SRTP_H