GreenCloud Simulator
taskalloc.h
Go to the documentation of this file.
1 /*
2  * taskalloc.h
3  *
4  * @date Sep 26, 2013
5  * @author Guzek:Mateusz
6  */
7 
8 #ifndef TASKALLOC_H_
9 #define TASKALLOC_H_
10 
11 #include "cloudtask.h"
12 class CoreScheduler;
13 
14 class TaskAlloc {
15  //TODO Try to optimize iterations over task allocations. (esp. usage of erase and resetting iterators)
16 public:
17  CloudTask* cloudTask; //cloudTask
18 
20  double executedSince_;
23  TaskAlloc(CloudTask * ct, int rd, int cap);
24  virtual ~TaskAlloc();
25 
26  double getMIPS();
27  double getDeadline();
28  void setExecTime(double execTime) {executedSince_ = execTime;};
31  bool operator==(const TaskAlloc &other) const;
32  void setComputingRate(double rate);
33  double execTime();
34  void updateMIPS();
35  void removeAfterFailure();
36 
37  void print();
38 private:
39  int rd;
40  int cap;
41 };
42 
43 #endif /* TASKALLOC_H_ */
CoreScheduler * core
Definition: taskalloc.h:19
int rd
Definition: taskalloc.h:39
int cap
Definition: taskalloc.h:40
double getMIPS()
Definition: taskalloc.cc:21
bool operator==(const TaskAlloc &other) const
Definition: taskalloc.cc:35
virtual ~TaskAlloc()
Definition: taskalloc.cc:12
void removeAfterFailure()
void setCoreScheduler(CoreScheduler *cs)
Definition: taskalloc.cc:28
void updateMIPS()
Definition: taskalloc.cc:54
TaskAlloc(CloudTask *ct, int rd, int cap)
Definition: taskalloc.cc:16
double executedSince_
Definition: taskalloc.h:20
CloudTask * cloudTask
Definition: taskalloc.h:17
void print()
Definition: taskalloc.cc:50
double execTime()
Definition: taskalloc.cc:73
CoreScheduler * getCoreScheduler()
Definition: taskalloc.cc:31
void setComputingRate(double rate)
Definition: taskalloc.cc:43
double getDeadline()
Definition: taskalloc.cc:24
void setExecTime(double execTime)
Definition: taskalloc.h:28