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 
00049 
00050 
00051 
00052 
00053 #ifndef SGANTTCHART_H
00054 #define SGANTTCHART_H
00055 
00056 
00057 #include <LEDA/array.h>
00058 #include <LEDA/list.h>
00059 #ifndef leda_list_item
00060 #define leda_list_item list_item
00061 #endif
00062 #include <LEDA/sortseq.h>
00063 #ifndef leda_seq_item
00064 #define leda_seq_item seq_item
00065 #endif
00066 
00067 
00068 #include "../model/STaskSystem.h"
00069 
00074 class SGanttChart {
00075  public:
00076   NOCOPY(SGanttChart);
00077   DUMMYIO(SGanttChart);
00078 
00083   SGanttChart(STaskSystem& ts);
00084   
00088   ~SGanttChart();
00089 
00098   void jobAllocated(int jobIdx, int machine, double time, int operation = -1);
00105   void jobDeallocated(int jobIdx, int machine, double time);
00106   
00120   int getJob(int mach, double time, int& operation) const;
00121   
00136   int getMachine(int jobIdx, double time, int operation=-1) const;
00137 
00153   int getExecInfo(int jobIdx, leda_array<double>& start, leda_array<double>& end,
00154         leda_array<int>& machine, leda_array<int>& operation) const;
00155 
00163   const leda_list<double>& getTimeSteps() const 
00164     { return _timeSteps; }
00165 
00169   void reset();
00170   
00171  private:
00172   STaskSystem& _rTaskSys;
00173   
00174   leda_list<double> _timeSteps;
00175   
00176   
00177   struct ExecIntrvlInfo {
00178     double startTime;
00179     double endTime;
00180     int machine;
00181     int operation;
00182   };
00183   
00184   
00185   typedef leda_list<ExecIntrvlInfo*> JobToInfoList;
00186   leda_array<JobToInfoList> _jobToExecIntrvl; 
00187   
00188   typedef leda_sortseq<double,int> TimeToJobSeq;
00189   leda_array<TimeToJobSeq*> _machAndTimeToJob;
00190 };
00191 
00192 #endif // SGANTTCHART_H