|
@@ -5,10 +5,10 @@ public class CpsEdge {
|
|
|
float maxCapacity;
|
|
|
float flow;
|
|
|
boolean isWorking;
|
|
|
- //State represents the real status of the edge
|
|
|
- //If it breaks --> stay ruin no matter the actual scenario
|
|
|
- //The only way to repair it is through manual change (setStateEdge)
|
|
|
- boolean state = true;
|
|
|
+ // State represents the real status of the edge
|
|
|
+ // If it breaks --> stay ruin no matter the actual scenario
|
|
|
+ // The only way to repair it is through manual change (setStateEdge)
|
|
|
+ // boolean state = true;
|
|
|
|
|
|
CpsObject A;
|
|
|
CpsObject B;
|
|
@@ -55,10 +55,6 @@ public class CpsEdge {
|
|
|
return flow;
|
|
|
}
|
|
|
|
|
|
- public boolean getStateEdge() {
|
|
|
- return state;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* @param flow
|
|
|
* the flow to set
|
|
@@ -66,27 +62,23 @@ 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) {
|
|
|
- state = isActive;
|
|
|
+ isWorking = isActive;
|
|
|
}
|
|
|
|
|
|
/**
|