-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStep.java
More file actions
51 lines (44 loc) · 1.18 KB
/
Step.java
File metadata and controls
51 lines (44 loc) · 1.18 KB
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
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package anodizationscheduling;
import java.util.LinkedList;
import java.util.Vector;
/**
*
* @author edsa01
*/
public class Step {
public final Tank tank;
public final int duration;
public static final Vector<Step> steps = new Vector<Step>();
public int ts=1;
public int tl=0;
public Step(int tank, int duration) {
this.tank = new Tank(tank);
this.duration = duration;
steps.add(this);
}
public static int getPrevLowerBound(Anodizationprocess p, Step ofStep){
int val = 0;
for(Step s : p.steps){
if(s.equals(ofStep))
break;
val += s.duration;
}
return val;
}
public static int getUpperBound(int tmax, Anodizationprocess p, Step toStep){
LinkedList<Step> revList = new LinkedList<Step>(p.steps);
int val = tmax;
while(revList.size() > 0){
Step s = revList.removeLast();
if(s.equals(toStep))
break;
val -= s.duration;
}
val-= toStep.duration;
return val;
}
}