Commit 36dc113b authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

Do not hybridize bounds when instances have no dependencies

parent ee36c4a7
......@@ -28,7 +28,7 @@ string HybridBound::name() {
double HybridBound::compute(Instance& ins) {
if(!doHybrid) {
if(!doHybrid || ins.isIndependent) {
double result;
alg->init(ins);
if(timeLimit > 0)
......
......@@ -67,9 +67,12 @@ Instance::Instance(const string input_file, int convertIndices) {
readArray(input, taskTypes);
nbTasks = static_cast<unsigned int>(taskTypes.size());
isIndependent = true;
dependencies.resize(nbTasks);
for(i = 0; i < nbTasks; i++) {
readArray(input, dependencies[i]);
if(! dependencies[i].empty())
isIndependent = false;
}
int nbTaskNames = readArray(input, taskIDs);
......@@ -92,6 +95,7 @@ void Instance::removeDependencies() {
ancestors.clear();
revDep.clear();
topOrder.clear();
isIndependent = true;
}
......
......@@ -13,8 +13,9 @@ public:
std::vector<int> nbWorkers;
std::vector<std::vector<int>> workerIDs;
std::vector< std::vector<double> > execTimes;
std::vector< std::vector<int> > dependencies;
std::vector<int> taskTypes;
std::vector< std::vector<int> > dependencies;
bool isIndependent;
std::vector<int> taskTypes;
unsigned int nbTasks;
unsigned int totalWorkers;
unsigned int nbTaskTypes;
......@@ -86,8 +87,8 @@ public:
void removeDependencies();
void revertDependencies();
protected:
void updateTopOrder(std::vector<int>& computed, int i, int &l);
protected:
void updateTopOrder(std::vector<int>& computed, int i, int &l);
void computeTopOrder();
void computeAncestors();
void computeRevDependencies();
......
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