fr_b02 / petri / src / arc / ArcZero.java @ 3
Historique | Voir | Annoter | Télécharger (1,278 ko)
1 | 3 | a19coudr | package arc; |
---|---|---|---|
2 | 2 | a19coudr | |
3 | 3 | a19coudr | import element.Place; |
4 | |||
5 | 2 | a19coudr | public class ArcZero extends ArcOutering { |
6 | |||
7 | public ArcZero(Place place, int value) { |
||
8 | super(place, value);
|
||
9 | // TODO Auto-generated constructor stub
|
||
10 | } |
||
11 | |||
12 | public void doTransition() { |
||
13 | } |
||
14 | public boolean isActive() { |
||
15 | return (this.getPlace().getToken()==0); |
||
16 | } |
||
17 | public boolean isPullable() { |
||
18 | return this.isActive(); |
||
19 | } |
||
20 | public String toString() { |
||
21 | return "ArcZero, "+this.getPlace(); |
||
22 | } |
||
23 | public static void main(String[] args) { |
||
24 | System.out.println("TEST METHODS ARCZERO"); |
||
25 | |||
26 | System.out.println(" => method isActive()"); |
||
27 | Place emptyPlace = new Place(0); |
||
28 | ArcZero arcc1 = new ArcZero(emptyPlace,2); |
||
29 | Place place3 = new Place(3); |
||
30 | ArcZero arcc2 = new ArcZero(place3,2); |
||
31 | System.out.println(arcc1);
|
||
32 | System.out.println("true : "+arcc1.isActive()); |
||
33 | System.out.println(arcc2);
|
||
34 | System.out.println("false : "+arcc2.isActive()); |
||
35 | |||
36 | |||
37 | System.out.println(" => method isPullable()"); |
||
38 | System.out.println(arcc1);
|
||
39 | System.out.println("false : "+arcc1.isPullable()); |
||
40 | System.out.println(arcc2);
|
||
41 | System.out.println("true : "+arcc2.isPullable()); |
||
42 | |||
43 | System.out.println(" => method doTranstion()"); |
||
44 | System.out.println("before : "+arcc2); |
||
45 | arcc2.doTransition(); |
||
46 | System.out.println("after : "+arcc2); |
||
47 | |||
48 | } |
||
49 | |||
50 | } |