DepBound.h 1.14 KB
Newer Older
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
1
2
3
#ifndef DEPBOUND_H
#define DEPBOUND_H

EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
4
#include <iostream>
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
5
6
7
8
9
10
11
12
13
14
15
#include <ilcplex/ilocplex.h>
#include <map>
#include <vector>

#include "algorithm.h"
#include "HybridBound.h"

typedef IloArray<IloNumVarArray> NumVarMatrix;

class DepBound : public ModifiableBound {

EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
16
17
 protected: 

18
  Instance *instance; 
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
19
20
21
  IloEnv env; 

  int verbosity; 
22
23
  //  int firstlimit; 
  std::string mode;
24
  std::string shareKey;
25
26
  // True if we should use the rounding from https://arxiv.org/abs/1912.03088
  bool bVersion;
27
  
28
29
  unsigned int nbWorkerTypes;
  unsigned int nbTasks;
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
30
31
32
33
34
35
36
37
38
39
  IloModel idc; 
  IloCplex idcCplex; 
  NumVarMatrix wType; 
  IloNumVar load; 
  IloNumVarArray startTime; 
  std::vector<bool> isRemoved;
  IloExprArray execTime; 
  IloRangeArray onlyOnce; 
  IloObjective objective; 

40
  bool outputInteger; 
41
42
  bool integerSolution; 
  
43
44
  void clear();

45

EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
46
 public: 
47
  DepBound(const AlgOptions & options); 
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
48
49
50
  
  void init(Instance& ins);
  double compute(); 
51
  void finalize(); 
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
52
53
  void removeTask(int taskID); 
  void restoreTask(int taskID);
54
  std::string name() {return "depbound"; }
55
  double tryHard(int timeLimit); 
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
56
57
    

58
  std::vector<int> getAllocTasks(); 
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
59
60
61
62
63
64
65

};




#endif