Go to the documentation of this file.00001
00013 #ifndef VIRTUAL_TASK_H
00014 #define VIRTUAL_TASK_H
00015
00016 #include <iostream>
00017 #include <string>
00018 #include <vector>
00019 #include <map>
00020 #include <set>
00021 using namespace std;
00022
00023 #include "RZ.h"
00024 #include "device.h"
00025
00026 #include "task.h"
00027
00028
00029 class VirtualTask : public Task {
00030
00031 private:
00032 map<RBType, int> resourceMap;
00033 Device *device;
00034
00035 bool RZSetAlreadyDetermined;
00036
00037 public:
00038
00039 VirtualTask(string n, vector<Task> tasks, Device *dev) {
00040
00041 name = n;
00042 device = dev;
00043
00044
00045
00046
00047 for(int i = 0; i < (int) tasks.size(); i++) {
00048 map<RBType, int>::iterator it;
00049 map<RBType, int> res = tasks.at(i).getResourceRequirementsPtr()->getPhysicalResources();
00050 for(it = res.begin(); it != res.end(); it++) {
00051 if(resourceMap[it->first] < it->second) resourceMap[it->first] = it->second;
00052 }
00053 }
00054
00055 info();
00056
00057
00058
00059 resourceRequirements = new ResourceRequirements(resourceMap, device);
00060
00061
00062
00063
00064
00065 }
00066
00067 void info();
00068
00069 };
00070
00071 #endif