00001 /* #start# *********************************************************** 00002 00003 Scheduling Simulator 00004 Lehrstuhl f"ur Effiziente Algorithmen 00005 Technische Universit"at M"unchen 00006 00007 File : $Id: SMachines.h,v 1.6 2003/01/24 10:04:55 hall Exp $ 00008 00009 Purpose : a block of active machines, i.e., machines that actually 00010 process jobs. the main difference to passive machines 00011 is the event handler, which takes care of the processing 00012 state of the jobs 00013 00014 RCS-Log: 00015 $Log: SMachines.h,v $ 00016 Revision 1.6 2003/01/24 10:04:55 hall 00017 brdCast stuff 00018 00019 Revision 1.5 2003/01/08 18:57:12 meierb 00020 added randomized release times 00021 00022 Revision 1.2 2002/12/16 23:32:09 meierb 00023 *** empty log message *** 00024 00025 Revision 1.1.1.1 2002/12/02 22:26:19 meierb 00026 my_schedule 00027 00028 Revision 1.3 2002/11/11 16:52:52 taeubig 00029 header include changes 00030 00031 Revision 1.2 2002/11/07 12:33:25 taeubig 00032 Added class keyword to friend declaration 00033 00034 Revision 1.1 2002/08/29 12:59:58 taeubig 00035 Added the sources 00036 00037 Revision 1.19 2000/05/29 19:54:01 taeubig 00038 New subdirectory structure 00039 00040 Revision 1.18 2000/05/29 14:01:28 taeubig 00041 Added SComplexPosition 00042 00043 Revision 1.17 2000/05/29 13:17:38 schickin 00044 _pTaskSys removed from Machines (is already in PassiveMachines) 00045 00046 Revision 1.16 2000/01/17 17:38:09 zoidl 00047 added javadoc comments 00048 00049 Revision 1.15 1999/11/17 00:19:28 zoidl 00050 added isEnvAvail() 00051 00052 Revision 1.14 1999/10/29 10:46:39 schickin 00053 line topology (between mesh and single-top.) added 00054 00055 Revision 1.13 1999/10/27 12:57:32 schickin 00056 bug SJob::reset() removed, simTime-Handling and parsing of doubles changed 00057 00058 Revision 1.12 1999/08/05 13:02:58 schickin 00059 redesign: event list for algorithm is generated by logger now 00060 00061 Revision 1.11 1999/08/05 08:48:05 schickin 00062 purpose of important classes noted in the header-files 00063 00064 Revision 1.10 1999/06/17 16:34:35 hall 00065 STopology changed, tuned STSysSchedEvent-stuff and lost more! 00066 00067 Revision 1.9 1999/05/06 14:51:39 schickin 00068 event handling by jobs and machines redesigned 00069 00070 Revision 1.8 1999/05/04 12:11:03 schickin 00071 small bugs removed (which came from the redesign of the diagrams) 00072 00073 Revision 1.7 1999/04/28 14:47:52 schickin 00074 All diagrams reformatted 00075 00076 Revision 1.6 1999/04/27 13:39:24 schickin 00077 well folks, that's the first demo version that really runs 8-) 00078 00079 Revision 1.5 1999/04/23 13:24:30 schickin 00080 just transferring things to hpmayr 00081 00082 Revision 1.4 1999/03/23 14:26:45 schickin 00083 a lot of new code in /model: things compile but have no functionality 00084 00085 Revision 1.3 1999/02/10 10:50:45 schickin 00086 main loop for simulation added 00087 00088 Revision 1.2 1999/01/29 10:03:40 schickin 00089 Project-Headers added. 00090 00091 00092 * #end# ************************************************************* */ 00093 00094 #ifndef SMACHINES_H 00095 #define SMACHINES_H 00096 00097 // system header files 00098 #include <LEDA/dictionary.h> 00099 00100 // project header files 00101 #include "SPassiveMachines.h" 00102 #include "STSysSchedEvent.h" 00103 #include "SMachinesMod.h" 00104 #include "SJobExecInfo.h" 00105 #include "env/SEnvironment.h" 00106 #include "jobs/SJob.h" 00107 #include "topos/STopology.h" 00108 #include "topos/SComplexPosition.h" 00109 00116 class SMachines : public SPassiveMachines { 00117 private: 00119 /*# SJobExecInfo lnkUnnamed; */ 00120 friend class SMachinesMod; 00121 NOCOPY(SMachines); 00122 public: 00125 SMachines(STaskSystem& rTS); 00126 00130 virtual void deallocate(SJob& job); 00131 00139 virtual void allocate(SJob& job, int pos = -1); 00140 virtual void allocate(SJob& job, SComplexPosition* pComplexPos); 00141 00147 double getFinishTime(double currTime, SJob& job) const; 00148 00149 // simulation control 00150 00157 virtual double getNextEventTime(double currTime) const; 00158 00164 virtual void simulate(double oldTime, double newTime); 00165 00169 bool isEnvAvail() const { return (_pEnv != NULL); }; 00170 00173 const SEnvironment& getEnv() const { return *_pEnv; }; 00174 00177 SEnvironment& getEnv() { return *_pEnv; }; 00178 00181 virtual SPassiveMachinesMod& getModifier() 00182 { return _mod; }; 00183 00186 SMachinesMod& getMachModifier() 00187 { return _mod; }; 00188 00189 private: 00193 SEnvironment* _pEnv; 00194 00195 SMachinesMod _mod; 00196 }; 00197 00198 #endif //SMACHINES_H 00199 00200 00201 00202