-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEdge.java
53 lines (46 loc) · 1.12 KB
/
Edge.java
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
import java.util.ArrayList;
/**
* The Edge class represents an edge in a Petri net.
* Each edge has an associated value that can be modified.
*/
public class Edge {
private int value;
/**
* Constructs a new Edge object with a specified value.
*
* @param value the initial value of the edge
*/
public Edge(int value){
this.value = value;
}
/**
* Triggers an action associated with this edge and prints a message to the console.
*/
public void trigger(){
System.out.println("triggered");
}
/**
* Checks if the edge is triggerable.
*
* @return true, as the edge is always triggerable in the current implementation
*/
public boolean isTriggerable(){
return true;
}
/**
* Gets the value of the edge.
*
* @return the current value of the edge
*/
public int getValue() {
return value;
}
/**
* Sets the value of the edge.
*
* @param value the new value to be assigned to the edge
*/
public void setValue(int value) {
this.value = value;
}
}