Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 595c574d authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

instance: now extraData is type void*, no functionality change

parent 0c08b509
......@@ -38,10 +38,10 @@ double GreedyFile::compute(Instance & instance, SchedAction* action) {
ins = &instance;
if(file.substr(0, 4) == "int@") {
vector<double> values = ins->extraData[file.substr(4)];
vector<int>* values = (vector<int>*) ins->extraData[file.substr(4)];
preAssign.resize(ins->nbTasks);
for(int i = 0; i < ins->nbTasks; i++)
preAssign[i] = (int) values[i];
preAssign[i] = (*values)[i];
} else {
ifstream inputStream(file);
if(!inputStream) {
......
......@@ -217,7 +217,7 @@ double IntervalBound::compute(Instance & ins) {
result = modcplex.getObjValue();
/* Now, let us fill the instance data with the results of this */
vector<double> alloc(nbTasks, -1);
vector<int> alloc(nbTasks, -1);
vector<double> averageInterval(nbTasks, 0);
vector<double> medianInterval(nbTasks, -1);
......@@ -257,9 +257,9 @@ double IntervalBound::compute(Instance & ins) {
cerr << "IntBound: avg: " << averageInterval << endl;
}
instance->extraData["interval[alloc]"] = alloc;
instance->extraData["interval[med]"] = medianInterval;
instance->extraData["interval[avg]"] = averageInterval;
instance->extraData["interval[alloc]"] = new vector<int>(alloc);
instance->extraData["interval[med]"] = new vector<double>(medianInterval);
instance->extraData["interval[avg]"] = new vector<double>(averageInterval);
return result;
......
......@@ -42,7 +42,7 @@ intCompare* RankComputer::oneCmp(Instance& ins, string subRankOpt) {
// Those files give lower values to higher priority tasks
} else if(subRankOpt.substr(0, 4) == "int@") {
string key = subRankOpt.substr(4);
w = ins.extraData.at(key);
w = * ((vector<double>*) ins.extraData.at(key));
// reverse = true;
}
else {
......
......@@ -17,7 +17,7 @@ public:
int nbTaskTypes;
int nbWorkerTypes;
std::map<std::string, std::vector<double> > extraData;
std::map<std::string, void*> extraData;
// Those are optional, let's say. To be supported in the next version
/* IloArray<string> workerNames;
......
......@@ -112,6 +112,6 @@ void InternalShare::onSchedule(int i, int w, double s, double f) {
}
void InternalShare::finish() {
instance->extraData[shareName + "[alloc]"] = (allocation);
instance->extraData[shareName + "[start]"] = (startTimes);
instance->extraData[shareName + "[alloc]"] = new vector<int>(allocation);
instance->extraData[shareName + "[start]"] = new vector<double>(startTimes);
}
......@@ -53,7 +53,7 @@ class UtilAnalysis : public SchedAction {
class InternalShare : public SchedAction {
std::string shareName;
Instance* instance;
std::vector<double> allocation;
std::vector<int> allocation;
std::vector<double> startTimes;
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment