Explorar o código

Merge branch 'Ohne_Drag_and_Drop' of https://git.tk.informatik.tu-darmstadt.de/carlos.garcia/praktikum-holons into Ohne_Drag_and_Drop

Jessey Widhalm %!s(int64=8) %!d(string=hai) anos
pai
achega
0e201390d2
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/classes/CpsEdge.java

+ 6 - 0
src/classes/CpsEdge.java

@@ -4,6 +4,7 @@ public class CpsEdge {
 
 	float maxCapacity;
 	float flow;
+	boolean isWorking;
 	
 	CpsObject A;
 	CpsObject B;
@@ -14,6 +15,8 @@ public class CpsEdge {
 		this.A.AddConnection(this);
 		this.B.AddConnection(this);
 		this.maxCapacity = 100;
+		flow = 0;
+		isWorking = true;
 	}
 	
 	
@@ -43,6 +46,9 @@ public class CpsEdge {
 	 */
 	public void setFlow(float flow) {
 		this.flow = flow;
+		if(flow > maxCapacity){
+			isWorking = false;
+		}
 	}
 	
 	/**