|
@@ -1,14 +1,17 @@
|
|
|
package classes;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+
|
|
|
public class CpsEdge {
|
|
|
|
|
|
float maxCapacity;
|
|
|
float flow;
|
|
|
boolean isWorking;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ArrayList<Integer> tags;
|
|
|
|
|
|
CpsObject A;
|
|
|
CpsObject B;
|
|
@@ -62,25 +65,25 @@ public class CpsEdge {
|
|
|
public void setFlow(float flow) {
|
|
|
this.flow = flow;
|
|
|
|
|
|
- * if (flow <= maxCapacity || flow == -1) { isWorking = true; } else {
|
|
|
- * isWorking = false; state = false; }
|
|
|
- **/
|
|
|
+ if (flow <= maxCapacity || flow == -1) {
|
|
|
+ isWorking = true;
|
|
|
+ } else {
|
|
|
+ isWorking = false;
|
|
|
+ state = false;
|
|
|
+ }
|
|
|
+ **/
|
|
|
}
|
|
|
-
|
|
|
- public void calculateState(boolean simMode) {
|
|
|
- if (flow > maxCapacity && maxCapacity != -1) {
|
|
|
+
|
|
|
+ public void calculateState(boolean simMode){
|
|
|
+ if(flow > maxCapacity && maxCapacity != -1){
|
|
|
isWorking = false;
|
|
|
- } else {
|
|
|
- if (!simMode && flow <= maxCapacity) {
|
|
|
+ }else {
|
|
|
+ if(!simMode && flow <= maxCapacity){
|
|
|
isWorking = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void setState(boolean isActive) {
|
|
|
- isWorking = isActive;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
* @return the a
|
|
|
*/
|
|
@@ -110,9 +113,25 @@ public class CpsEdge {
|
|
|
public void setB(CpsObject b) {
|
|
|
B = b;
|
|
|
}
|
|
|
+
|
|
|
+ public void setState(boolean state){
|
|
|
+ isWorking = state;
|
|
|
+ }
|
|
|
|
|
|
public boolean getState() {
|
|
|
return isWorking;
|
|
|
}
|
|
|
+
|
|
|
+ public void setTags(ArrayList<Integer> tags){
|
|
|
+ this.tags = tags;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ArrayList<Integer> getTags(){
|
|
|
+ return tags;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void addTag(int tag){
|
|
|
+ tags.add(tag);
|
|
|
+ }
|
|
|
|
|
|
}
|