00001 /* #start# *********************************************************** 00002 00003 Scheduling Simulator 00004 Lehrstuhl f"ur Effiziente Algorithmen 00005 Technische Universit"at M"unchen 00006 00007 File : $Id: SMeshTopology.h,v 1.5 2003/01/08 18:57:14 meierb Exp $ 00008 00009 Purpose : 00010 00011 RCS-Log: 00012 $Log: SMeshTopology.h,v $ 00013 Revision 1.5 2003/01/08 18:57:14 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.3 2002/11/09 23:21:58 taeubig 00020 Added std:: for standard namespace, 00021 realtive path corrections for header includes 00022 00023 Revision 1.2 2002/11/07 12:33:25 taeubig 00024 Added class keyword to friend declaration 00025 00026 Revision 1.1 2002/08/29 12:59:59 taeubig 00027 Added the sources 00028 00029 Revision 1.3 2000/07/02 23:41:00 taeubig 00030 Updated class tree for n-dimensional, 2-dimensional, 1-dimensional 00031 meshes (SMeshN, SMeshTopology, SLineTopology) 00032 NOTE: virtual base classes have changed (only STopology is virtual) 00033 00034 Revision 1.2 2000/05/29 19:48:12 taeubig 00035 Moved topology related files into subdirectory topos 00036 00037 Revision 1.1 2000/05/29 14:44:34 taeubig 00038 Moved topology related stuff into subdirectory topos 00039 00040 Revision 1.23 2000/05/24 12:46:11 taeubig 00041 New compiler (gcc-2.95) and new Qt (2.1) 00042 Replaced "list" by "leda_list" etc. 00043 00044 Revision 1.22 2000/05/09 13:33:15 taeubig 00045 Defined fitsInto() (replaces isSmaller()) 00046 00047 Revision 1.21 2000/01/17 12:06:45 zoidl 00048 added javadoc comments 00049 00050 Revision 1.20 1999/12/22 17:05:36 hall 00051 STopology is observable, added SJobArray::resize() + SLineTopMod::setSize() 00052 00053 Revision 1.19 1999/11/23 15:57:34 taeubig 00054 Moved simple implementation of getFreePos() from SMeshTopology to STopology 00055 00056 Revision 1.18 1999/11/18 15:25:20 zoidl 00057 setSize() is private now 00058 00059 Revision 1.17 1999/11/18 13:41:08 zoidl 00060 del'd unnecessary friends 00061 00062 Revision 1.16 1999/11/17 11:21:51 taeubig 00063 Added clear() 00064 00065 Revision 1.15 1999/11/03 02:50:53 taeubig 00066 Loop bounds were buggy in embed and canEmbedAt. 00067 00068 Revision 1.14 1999/11/02 12:18:23 zoidl 00069 added modifier for SLineTopology 00070 00071 Revision 1.13 1999/10/29 10:46:41 schickin 00072 line topology (between mesh and single-top.) added 00073 00074 Revision 1.12 1999/10/27 02:00:45 taeubig 00075 Added simple functionality for mesh topology. 00076 00077 Revision 1.11 1999/10/05 13:42:14 zoidl 00078 lots of new load- and save-routines 00079 00080 Revision 1.10 1999/09/21 20:29:56 zoidl 00081 problem with crashing linux programs at end of program solved 00082 00083 Revision 1.9 1999/06/17 16:34:36 hall 00084 STopology changed, tuned STSysSchedEvent-stuff and lost more! 00085 00086 Revision 1.8 1999/04/27 13:39:27 schickin 00087 well folks, that's the first demo version that really runs 8-) 00088 00089 Revision 1.7 1999/03/30 12:13:52 schickin 00090 dynamic_cast added, constructors for task system classes added 00091 00092 Revision 1.6 1999/03/19 16:45:13 hall 00093 nc 00094 00095 Revision 1.5 1999/02/12 11:55:43 hall 00096 impl. SEnvironment slice 00097 00098 Revision 1.4 1999/02/10 15:05:44 schickin 00099 model-directory can be compiled now 00100 00101 Revision 1.3 1999/01/29 10:03:40 schickin 00102 Project-Headers added. 00103 00104 00105 * #end# ************************************************************* */ 00106 00107 #ifndef SMESHTOPOLOGY_H 00108 #define SMESHTOPOLOGY_H 00109 00110 // system header files 00111 #include <LEDA/array.h> 00112 #include <LEDA/h_array.h> 00113 00114 // project header files 00115 #include "SMeshN.h" 00116 //#include "STopology.h" 00117 #include "SMeshTopologyMod.h" 00118 //#include "SLineTopologyMod.h" 00119 #include "../SPassiveMachinesMod.h" 00120 00121 // ------------------------------------------------------------ 00122 /* 00123 class SMeshTopEntry { 00124 public: 00125 int ID, width, height, pos; 00126 SMeshTopEntry() : ID(0), width(0), height(0), pos(-1) {}; 00127 SMeshTopEntry(int i, int w, int h, int p) : 00128 ID(i), width(w), height(h), pos(p) {}; 00129 00130 friend istream &operator>>(istream &i, SMeshTopEntry &e) { return i; }; 00131 friend ostream &operator<<(ostream &o, const SMeshTopEntry &e) { return o; }; 00132 }; 00133 */ 00134 // ------------------------------------------------------------ 00139 //class SMeshTopology : public virtual SMeshN { 00140 class SMeshTopology : public SMeshN { 00141 TYPEINFO0(SMeshTopology, "mesh2"); 00142 friend class SMeshTopologyMod; 00143 public: 00148 SMeshTopology(int width, int height); 00149 00152 virtual ~SMeshTopology() {} 00153 00156 virtual STopologyMod &getModifier() 00157 { return _mod; }; 00158 00163 //virtual int getCount() const { return _width * _height; }; 00164 00168 //virtual int getWidth() const { return _width; }; 00169 //virtual int getWidth() const { return _size[0]; }; 00170 virtual int getWidth() const { return SMeshN::getSize()[0]; }; 00171 00175 //virtual int getHeight() const { return _height; }; 00176 //virtual int getHeight() const { return _size[1]; }; 00177 virtual int getHeight() const { return SMeshN::getSize()[1]; }; 00178 00183 //virtual int getIDAt(int pos) const; 00184 00189 //virtual int getPos(int ID) const; 00190 00195 //virtual bool isPosFree(int pos) const; 00196 00202 //virtual bool canEmbedAt(const STopology &top, int pos) const; 00203 00204 // /** @return list of all position where the topology may be embedded */ 00205 // virtual list<int> canEmbedAt(const STopology &top) const { 00206 // // MISSING IMPLEMENTATION ! 00207 // return _free; 00208 // } 00209 00215 //virtual void embed(const STopology& top, int pos, int ID); 00216 00220 //virtual void remove(int ID); 00221 00224 //virtual void clear(); 00225 00226 /* 00227 virtual bool fitsInto(const STopology *top) const { 00228 const SMeshTopology *meshtop = dynamic_cast<const SMeshTopology*>(top); 00229 return ((_width <= meshtop->getWidth()) && 00230 (_height <= meshtop->getHeight())); 00231 } 00232 */ 00233 00234 private: 00235 /* 00236 int _width; 00237 int _height; 00238 */ 00239 00240 SMeshTopologyMod _mod; 00241 //list<int> _free; 00242 00243 // TS: the following member variables are also modified by SLineTopology 00244 // (but in a much simpler way than by SMeshTopology) 00245 // that's why they are only protected (sorry, Alex ;-) ) 00246 protected: 00247 /* 00248 leda_array<int> _idAtPos; 00249 // Hashing array for getPos 00250 leda_h_array<int, SMeshTopEntry*> _IDtoEntry; 00251 static SMeshTopEntry _defaultEntry; 00252 */ 00253 00254 void setSize(int width, int height); 00255 }; 00256 00257 #endif //SMESHTOPOLOGY_H