fr_b02 / petri / src / arcElement / ArcCleaner.java @ 4
Historique | Voir | Annoter | Télécharger (521 octets)
1 |
package arcElement; |
---|---|
2 |
|
3 |
import element.Place; |
4 |
|
5 |
public class ArcCleaner extends Arc{ |
6 |
|
7 |
|
8 |
public ArcCleaner(Place place) {
|
9 |
super(place);
|
10 |
|
11 |
} |
12 |
|
13 |
public void doTransition() { |
14 |
if (this.isActive()==true) { |
15 |
this.getPlace().changeToken(-this.getPlace().getToken()); |
16 |
} |
17 |
} |
18 |
|
19 |
public boolean isActive() { |
20 |
return (this.getPlace().getToken()>0); |
21 |
} |
22 |
|
23 |
public boolean isPullable() { |
24 |
return this.isActive(); |
25 |
} |
26 |
public String toString() { |
27 |
return "ArcCleaner, "+this.getPlace(); |
28 |
} |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
} |