fr_b02 / petri / src / arcElement / ArcZero.java @ 6
Historique | Voir | Annoter | Télécharger (840 octets)
1 |
package arcElement; |
---|---|
2 |
|
3 |
|
4 |
|
5 |
import element.Place; |
6 |
|
7 |
|
8 |
|
9 |
public class ArcZero extends ArcOutering { |
10 |
/**
|
11 |
* @param the place link to ArcZero and the value of this Arc
|
12 |
* Constructor for ArcZero
|
13 |
*
|
14 |
*/
|
15 |
public ArcZero(Place place, int value) { |
16 |
super(place, value);
|
17 |
} |
18 |
/**
|
19 |
* Do the transition for the ArcZero (do nothing)
|
20 |
*
|
21 |
*/
|
22 |
public void doTransition() { |
23 |
} |
24 |
/**
|
25 |
* Check if the place is active
|
26 |
*@return true if place token at 0
|
27 |
*/
|
28 |
public boolean isActive() { |
29 |
return (this.getPlace().getToken()==0); |
30 |
} |
31 |
/**
|
32 |
* Check if the place is pullable
|
33 |
*@return true if place token at 0
|
34 |
*/
|
35 |
public boolean isPullable() { |
36 |
return this.isActive(); |
37 |
} |
38 |
/**
|
39 |
* @return a string that describe the ArcZero
|
40 |
*
|
41 |
*/
|
42 |
public String toString() { |
43 |
return "ArcZero, "+this.getPlace(); |
44 |
} |
45 |
|
46 |
|
47 |
} |