-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCriticalPath2.txt
69 lines (56 loc) · 1.64 KB
/
CriticalPath2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*********************************************
* OPL 12.9.0.0 Model
* Author: IU-DP
* Creation Date: Feb 20, 2023 at 11:20:58 AM
*********************************************/
int numNode=8;
tuple Node{
int ID;
int pro;
string des;
}
tuple SimArc{
int ID1;
int ID2;
}
setof(Node) NodeSet={<1,4,"Design production tooling">,
<2,6,"Prepare manufacturing drawings">,
<3,10,"Prepare production facility for new tools and parts">,
<4,12,"Procure tooling">,
<5,10,"Manual testing of software">,
<6,2,"Kit parts">,
<7,4,"Orientation of new personnel">,
<8,2,"System testing">};
setof(SimArc) SimArcSet={<1,4>,<2,5>,<3,6>,<4,6>,<5,6>,<3,7>,<4,7>,<6,8>,<7,8>};
dvar float+ ES[NodeSet];
dvar float+ EC[NodeSet];
dvar float+ LS[NodeSet];
dvar float+ LC[NodeSet];
dvar float+ Slack[NodeSet];
dvar float+ Cmax;
dexpr float obj1=Cmax;
dexpr float obj2=-sum(n in NodeSet)Slack[n];
minimize staticLex(obj1,obj2);
subject to{
forall(n in NodeSet){
Cmax >=EC[n];
EC[n]==ES[n]+n.pro;
LC[n]==LS[n]+n.pro;
Slack[n]==LS[n]-ES[n];
}
forall(n1 in NodeSet, n2 in NodeSet:<n1.ID,n2.ID> in SimArcSet){
EC[n1]<=ES[n2];
LC[n1]<=LS[n2];
}
EC[<8,2,"System testing">]==LC[<8,2,"System testing">];
}
execute RESULT
{
var file =new IloOplOutputFile("Result.txt");
for( n in NodeSet){
file.writeln("Des:--",n.ID,"--",n.des,"--");
file.writeln("ES:--",n.ID,"--",ES[n],"--");
file.writeln("EC:--",n.ID,"--",EC[n],"--");
}
file.close();
}