Browse Source

Clean Up 2!

Tom Troppmann 5 years ago
parent
commit
c3c7b4cf94

+ 0 - 11
src/classes/Constants.java

@@ -1,11 +0,0 @@
-package classes;
-
-public class Constants {
-
-	// Environment Constants
-
-	public static float gravity = 2000f;  // pixels per second
-	public static float restitution = 0.85f;
-	public static float epsilon = 0.000009f;
-
-}

+ 21 - 27
src/classes/ExitCable.java

@@ -1,46 +1,40 @@
 package classes;
 
 import ui.model.DecoratedCable;
-
 /**
- * A VisualRepresentation to represent a connection from a UpperNode to a AbstactCpsObject, but actually the UpperNode is not connected.
+ * For the Visual State.
  * @author Tom
  *
  */
 public class ExitCable {
-	private AbstractCpsObject outsideObject;
-	private AbstractCpsObject insideObject;
-	private CpsUpperNode getInsideUpperNode;
-	private CpsUpperNode getOutsideUpperNode;
+	//Classification 
+	public enum ExitCableState {
+		UP, DOWN, DOWNUP, DOWNDOWN
+	}
+	private ExitCableState state;
+	//GroupNode or AbstractCpsObject
+	private AbstractCpsObject start;
+	private AbstractCpsObject finish;
 	private DecoratedCable cable;
-	public ExitCable(DecoratedCable cable, CpsUpperNode getInsideUpperNode,CpsUpperNode getOutsideUpperNode, AbstractCpsObject insideObject, AbstractCpsObject outsideObject){
+	
+	public ExitCable(ExitCableState state, AbstractCpsObject start, AbstractCpsObject finish, DecoratedCable cable) {
+		this.state = state;
+		this.start = start;
+		this.finish = finish;
 		this.cable = cable;
-		this.getInsideUpperNode = getInsideUpperNode;
-		this.getOutsideUpperNode = getOutsideUpperNode;
-		this.insideObject = insideObject;
-		this.outsideObject = outsideObject;
 	}
-	public AbstractCpsObject getOusideObject() {
-		return outsideObject;
+
+	public ExitCableState getState() {
+		return state;
 	}
-	public AbstractCpsObject getInsideObject() {
-		return insideObject;
+	public AbstractCpsObject getStart() {
+		return start;
 	}
-	public CpsUpperNode getInsideUpperNode() {
-		return getInsideUpperNode;
+	public AbstractCpsObject getFinish() {
+		return finish;
 	}
 	public DecoratedCable getCable() {
 		return cable;
 	}
-	public CpsEdge getModel() {
-		return cable.getModel();
-	}
-	public CpsUpperNode getOutsideUpperNode() {
-		return getOutsideUpperNode;
-	}
-	public String toString() {
-		return getModel().toString();
-		
-	}
 
 }

+ 0 - 40
src/classes/ExitCableV2.java

@@ -1,40 +0,0 @@
-package classes;
-
-import ui.model.DecoratedCable;
-/**
- * For the Visual State.
- * @author Tom
- *
- */
-public class ExitCableV2 {
-	//Classification 
-	public enum ExitCableState {
-		UP, DOWN, DOWNUP, DOWNDOWN
-	}
-	private ExitCableState state;
-	//GroupNode or AbstractCpsObject
-	private AbstractCpsObject start;
-	private AbstractCpsObject finish;
-	private DecoratedCable cable;
-	
-	public ExitCableV2(ExitCableState state, AbstractCpsObject start, AbstractCpsObject finish, DecoratedCable cable) {
-		this.state = state;
-		this.start = start;
-		this.finish = finish;
-		this.cable = cable;
-	}
-
-	public ExitCableState getState() {
-		return state;
-	}
-	public AbstractCpsObject getStart() {
-		return start;
-	}
-	public AbstractCpsObject getFinish() {
-		return finish;
-	}
-	public DecoratedCable getCable() {
-		return cable;
-	}
-
-}

+ 2 - 1
src/classes/HolonBody.java

@@ -117,7 +117,8 @@ public class HolonBody implements Comparable<HolonBody> {
 			return;
 
 		// collision impulse
-		float i = (-(1.0f + Constants.restitution) * vn) / (im1 + im2);
+		float restitution = 0.85f;
+		float i = (-(1.0f + restitution) * vn) / (im1 + im2);
 		Vector2d impulse = mtd.multiply(i);
 
 		// change in momentum

+ 0 - 90
src/classes/HolonTransformer.java

@@ -1,90 +0,0 @@
-package classes;
-/**
- * The class HolonTransformer represents a Transformer that transforms a flow to a lower flow.
- * Transforemer are not used in the current State of the Project but could be used the future.
- * 
- * @author Gruppe14
- *
- */
-public class HolonTransformer extends AbstractCpsObject {
-
-	/* Ratio of the transformer */
-	float transformRatio;
-
-	/* Fixed transform value */
-	float transformFixed;
-	
-	float maxInput;
-	
-	float maxOutput;
-
-	/**
-	 * Constructor Set type of object (Transformer), its transform ratio and the
-	 * default name ("Transformer").
-	 * 
-	 * @param objName name for the Object
-	 */
-	public HolonTransformer(String objName) {
-		super(objName);
-	}
-
-	/**
-	 * Copy of the Object.
-	 * 
-	 * @param obj the Object to Copy
-	 */
-	public HolonTransformer(AbstractCpsObject obj) {
-		super(obj);
-		this.setTransformRatio(((HolonTransformer) obj).getTransformRatio());
-		this.setTransformFixed(((HolonTransformer) obj).getTransformFixed());
-	}
-
-	/**
-	 * Set transform ratio.
-	 * 
-	 * @param ratio
-	 *            desired ratio
-	 */
-	public void setTransformRatio(float ratio) {
-		this.transformRatio = ratio;
-	}
-
-	/**
-	 * Output the actual ratio of the transformer.
-	 * 
-	 * @return actual ratio of the transformer
-	 */
-	public float getTransformRatio() {
-		return this.transformRatio;
-	}
-
-	/**
-	 * Set fixed Transform Value.
-	 * 
-	 * @param fixed
-	 *            desired fixed Transform Value
-	 */
-	public void setTransformFixed(float fixed) {
-		this.transformFixed = fixed;
-	}
-
-	/**
-	 * Output the actual fixed Transform Value.
-	 * 
-	 * @return actual fixed Transform Value
-	 */
-	public float getTransformFixed() {
-		return this.transformFixed;
-	}
-
-	/**
-	 * Get the Output of the Transformer.
-	 * 
-	 * @return The Output
-	 */
-	public float getOutput() {
-		float output = 0;
-		return output;
-
-	}
-}

+ 46 - 0
src/classes/IntermediateCalculationCable.java

@@ -0,0 +1,46 @@
+package classes;
+
+import ui.model.DecoratedCable;
+
+/**
+ * A VisualRepresentation to represent a connection from a UpperNode to a AbstactCpsObject, but actually the UpperNode is not connected.
+ * @author Tom
+ *
+ */
+public class IntermediateCalculationCable {
+	private AbstractCpsObject outsideObject;
+	private AbstractCpsObject insideObject;
+	private CpsUpperNode getInsideUpperNode;
+	private CpsUpperNode getOutsideUpperNode;
+	private DecoratedCable cable;
+	public IntermediateCalculationCable(DecoratedCable cable, CpsUpperNode getInsideUpperNode,CpsUpperNode getOutsideUpperNode, AbstractCpsObject insideObject, AbstractCpsObject outsideObject){
+		this.cable = cable;
+		this.getInsideUpperNode = getInsideUpperNode;
+		this.getOutsideUpperNode = getOutsideUpperNode;
+		this.insideObject = insideObject;
+		this.outsideObject = outsideObject;
+	}
+	public AbstractCpsObject getOusideObject() {
+		return outsideObject;
+	}
+	public AbstractCpsObject getInsideObject() {
+		return insideObject;
+	}
+	public CpsUpperNode getInsideUpperNode() {
+		return getInsideUpperNode;
+	}
+	public DecoratedCable getCable() {
+		return cable;
+	}
+	public CpsEdge getModel() {
+		return cable.getModel();
+	}
+	public CpsUpperNode getOutsideUpperNode() {
+		return getOutsideUpperNode;
+	}
+	public String toString() {
+		return getModel().toString();
+		
+	}
+
+}

+ 3 - 3
src/ui/controller/HolonCanvasController.java

@@ -173,10 +173,10 @@ public class HolonCanvasController {
 				bodies.get(i).position.setY(
 						(float) (bodies.get(i).position.getY() + (bodies.get(i).velocity.getY() * (elapsedSeconds))
 								- ((bodies.get(i).position.getY() - center.getHeight()) / (50 + subCount))));
-
-				if (Math.abs(bodies.get(i).velocity.getX()) < Constants.epsilon)
+				float epsilon = 0.000009f;
+				if (Math.abs(bodies.get(i).velocity.getX()) < epsilon)
 					bodies.get(i).velocity.setX(0);
-				if (Math.abs(bodies.get(i).velocity.getY()) < Constants.epsilon)
+				if (Math.abs(bodies.get(i).velocity.getY()) < epsilon)
 					bodies.get(i).velocity.setY(0);
 			}
 		}

+ 1 - 1
src/ui/controller/NodeController.java

@@ -5,7 +5,7 @@ import classes.CpsEdge;
 import classes.CpsNode;
 import classes.CpsUpperNode;
 import classes.Position;
-import classes.ExitCable;
+import classes.IntermediateCalculationCable;
 import ui.model.Model;
 
 import java.awt.*;

+ 13 - 13
src/ui/controller/SimulationManager.java

@@ -4,7 +4,7 @@ import classes.*;
 import classes.comparator.EnergyMinToMaxComparator;
 import classes.comparator.MinEnergyComparator;
 import classes.comparator.WeakestBattery;
-import ui.model.CableWithState;
+import ui.model.IntermediateCableWithState;
 import ui.model.DecoratedCable;
 import ui.model.DecoratedCable.CableState;
 import ui.model.DecoratedSwitch.SwitchState;
@@ -86,10 +86,10 @@ public class SimulationManager {
 		ArrayList<MinimumNetwork> list =  new ArrayList<MinimumNetwork>();
 		MinimumModel minimumModel = new MinimumModel(model.getObjectsOnCanvas(), model.getEdgesOnCanvas());
 		//set all working:
-		for(CableWithState cable : minimumModel.getEdgeList()) {
+		for(IntermediateCableWithState cable : minimumModel.getEdgeList()) {
 			if(map.containsKey(cable.getModel())) cable.setState(map.get(cable.getModel()));
 		}
-		ArrayList<CableWithState> leftOver = new ArrayList<CableWithState>();
+		ArrayList<IntermediateCableWithState> leftOver = new ArrayList<IntermediateCableWithState>();
 		boolean doAnotherLoop = true;
 		while(doAnotherLoop) {
 			doAnotherLoop = false;
@@ -97,7 +97,7 @@ public class SimulationManager {
 			for(MinimumNetwork net : list) {
 				float energyOnCables = net.getHolonObjectList().stream().filter(object -> object.getEnergyAtTimeStep(timestep) > 0.0f).map(object -> object.getEnergyAtTimeStep(timestep)).reduce(0.0f, ((a,b) -> a + b));
 				//find the cable with the energy supplied from his two connected objects are the biggest, from all cables that the network give more energy than the cablecapacity. 
-				CableWithState cable = net.getEdgeList().stream().filter(aCable -> energyOnCables > aCable.getModel().getCapacity()).max((lhs,rhs) -> Float.compare(lhs.getEnergyFromConnetedAtTimestep(timestep), rhs.getEnergyFromConnetedAtTimestep(timestep))).orElse(null);
+				IntermediateCableWithState cable = net.getEdgeList().stream().filter(aCable -> energyOnCables > aCable.getModel().getCapacity()).max((lhs,rhs) -> Float.compare(lhs.getEnergyFromConnetedAtTimestep(timestep), rhs.getEnergyFromConnetedAtTimestep(timestep))).orElse(null);
 				if(cable != null) {
 					cable.setState(CableState.Burned);
 					doAnotherLoop = true;
@@ -111,7 +111,7 @@ public class SimulationManager {
 		}
 		ArrayList<DecoratedCable> leftOverDecoratedCables = new ArrayList<DecoratedCable>();
 		
-		for(CableWithState cable: leftOver) {
+		for(IntermediateCableWithState cable: leftOver) {
 			leftOverDecoratedCables.add(new DecoratedCable(cable.getModel(), cable.getState(), 0.0f));
 		}
 		ArrayList<DecoratedSwitch> listOfDecoratedSwitches = decorateSwitches(minimumModel, timestep);
@@ -142,15 +142,15 @@ public class SimulationManager {
 	 * @param leftOver
 	 * @return
 	 */
-	ArrayList<MinimumNetwork> calculateNetworks(MinimumModel minModel, int Iteration, ArrayList<CableWithState> leftOver){
+	ArrayList<MinimumNetwork> calculateNetworks(MinimumModel minModel, int Iteration, ArrayList<IntermediateCableWithState> leftOver){
 		//Copy minModel ObjectList
 		ArrayList<HolonObject> holonObjectList = new ArrayList<HolonObject>();
 		for(HolonObject holonObject: minModel.getHolonObjectList()) {
 			holonObjectList.add(holonObject);
 		}
 		//Copy minModelEdgeList
-		ArrayList<CableWithState> edgeList = new ArrayList<CableWithState>();
-		for(CableWithState cable: minModel.getEdgeList()) {
+		ArrayList<IntermediateCableWithState> edgeList = new ArrayList<IntermediateCableWithState>();
+		for(IntermediateCableWithState cable: minModel.getEdgeList()) {
 			edgeList.add(cable);
 		}
 		
@@ -161,7 +161,7 @@ public class SimulationManager {
 			//delete out of list
 			holonObjectList.remove(0);
 			//create a new Network
-			MinimumNetwork actualNetwork = new MinimumNetwork(new ArrayList<HolonObject>(), new ArrayList<CableWithState>());
+			MinimumNetwork actualNetwork = new MinimumNetwork(new ArrayList<HolonObject>(), new ArrayList<IntermediateCableWithState>());
 			actualNetwork.getHolonObjectList().add(lookAtObject);
 			//create List of neighbors
 			LinkedList<AbstractCpsObject> neighbors = new LinkedList<AbstractCpsObject>();
@@ -183,7 +183,7 @@ public class SimulationManager {
 		}	
 		if(leftOver!= null) {
 			leftOver.clear();
-			for(CableWithState cable: edgeList) {
+			for(IntermediateCableWithState cable: edgeList) {
 				leftOver.add(cable);
 			}
 		}
@@ -196,12 +196,12 @@ public class SimulationManager {
 	 * @param actualNetwork
 	 * @param neighbors
 	 */
-	void populateListOfNeighbors(ArrayList<CableWithState> edgeList, AbstractCpsObject lookAtObject,
+	void populateListOfNeighbors(ArrayList<IntermediateCableWithState> edgeList, AbstractCpsObject lookAtObject,
 			MinimumNetwork actualNetwork, LinkedList<AbstractCpsObject> neighbors) {
-		ListIterator<CableWithState> iter = edgeList.listIterator();
+		ListIterator<IntermediateCableWithState> iter = edgeList.listIterator();
 		while(iter.hasNext())
 		{
-			CableWithState lookAtEdge = iter.next();
+			IntermediateCableWithState lookAtEdge = iter.next();
 			if(lookAtEdge.getState() == CableState.Working && lookAtEdge.getModel().isConnectedTo(lookAtObject)) {
 				iter.remove();
 				actualNetwork.getEdgeList().add(lookAtEdge);

+ 4 - 4
src/ui/model/DecoratedGroupNode.java

@@ -4,8 +4,8 @@ import java.util.ArrayList;
 
 import classes.CpsNode;
 import classes.CpsUpperNode;
+import classes.IntermediateCalculationCable;
 import classes.ExitCable;
-import classes.ExitCableV2;
 /**
  * For the @VisualRepresentationalState only.
  * @author Tom
@@ -25,7 +25,7 @@ public class DecoratedGroupNode {
 	/**
 	 * Cables that exit this group node (a Layer Up). From a object in this group node to a object in a upper layer.
 	 */
-	private ArrayList<ExitCableV2> exitCableList;	
+	private ArrayList<ExitCable> exitCableList;	
 	private ArrayList<DecoratedSwitch> switchList;
 	private ArrayList<DecoratedGroupNode> groupNodeList;
 
@@ -38,7 +38,7 @@ public class DecoratedGroupNode {
 		this.consumerList = new ArrayList<Consumer>();
 		this.nodeList = new ArrayList<CpsNode>();
 		this.internCableList = new ArrayList<DecoratedCable>();
-		this.exitCableList = new ArrayList<ExitCableV2>();
+		this.exitCableList = new ArrayList<ExitCable>();
 		this.switchList = new ArrayList<DecoratedSwitch>();
 		this.groupNodeList = new ArrayList<DecoratedGroupNode>();
 	}
@@ -60,7 +60,7 @@ public class DecoratedGroupNode {
 	public ArrayList<DecoratedCable> getInternCableList() {
 		return internCableList;
 	}
-	public ArrayList<ExitCableV2> getExitCableList() {
+	public ArrayList<ExitCable> getExitCableList() {
 		return exitCableList;
 	}
 	public ArrayList<DecoratedSwitch> getSwitchList() {

+ 1 - 1
src/ui/model/DecoratedNetwork.java

@@ -172,7 +172,7 @@ public class DecoratedNetwork {
 	private void decorateCable(MinimumNetwork minimumNetwork, float energyToSupplyInTheNetwork) {
 		//DecoratedCables
 		//Minimum demand first:
-		for(CableWithState edge: minimumNetwork.getEdgeList()) {		
+		for(IntermediateCableWithState edge: minimumNetwork.getEdgeList()) {		
 			decoratedCableList.add(new DecoratedCable(edge.getModel(), edge.getState(), (edge.getState() == CableState.Working) ? energyToSupplyInTheNetwork : 0.0f));
 		}
 	}

+ 2 - 2
src/ui/model/CableWithState.java → src/ui/model/IntermediateCableWithState.java

@@ -9,10 +9,10 @@ import ui.model.DecoratedCable.CableState;
  * When all burning is done the Cable will be represented as a DecoratedCable.
  * @see DecoratedCable
  */
-public class CableWithState {
+public class IntermediateCableWithState {
 	private CableState state;
 	private CpsEdge model;
-	public CableWithState(CpsEdge model,CableState state)
+	public IntermediateCableWithState(CpsEdge model,CableState state)
 	{
 		this.model = model;
 		this.state = state;

+ 6 - 6
src/ui/model/MinimumModel.java

@@ -19,7 +19,7 @@ import ui.model.DecoratedCable.CableState;
 public class MinimumModel {
 	
 	private ArrayList<HolonObject> holonObjectList = new ArrayList<HolonObject>();
-	private ArrayList<CableWithState> cableList = new ArrayList<CableWithState>();
+	private ArrayList<IntermediateCableWithState> cableList = new ArrayList<IntermediateCableWithState>();
 	private ArrayList<CpsNode> nodeList = new ArrayList<CpsNode>();
 	private ArrayList<HolonSwitch> switchList = new ArrayList<HolonSwitch>();
 	
@@ -40,7 +40,7 @@ public class MinimumModel {
 			}
 		}
 		for (CpsEdge edge : edgeList) {
-			this.cableList.add(new CableWithState(edge, CableState.Working));
+			this.cableList.add(new IntermediateCableWithState(edge, CableState.Working));
 		}
 	}
 
@@ -56,11 +56,11 @@ public class MinimumModel {
 			inGroupObjects.put(aCps, aUpperNode);
 		}
 		for (CpsEdge edge : aUpperNode.getNodeEdges()) {
-			this.cableList.add(new CableWithState(edge, CableState.Working));
+			this.cableList.add(new IntermediateCableWithState(edge, CableState.Working));
 			inGroupEdges.put(edge, aUpperNode);
 		}
 		for (CpsEdge edge : aUpperNode.getOldEdges()) {
-			this.cableList.add(new CableWithState(edge, CableState.Working));
+			this.cableList.add(new IntermediateCableWithState(edge, CableState.Working));
 			inGroupEdges.put(edge, aUpperNode);
 		}
 	}
@@ -71,10 +71,10 @@ public class MinimumModel {
 	public void setHolonObjectList(ArrayList<HolonObject> holonObjectList) {
 		this.holonObjectList = holonObjectList;
 	}
-	public ArrayList<CableWithState> getEdgeList() {
+	public ArrayList<IntermediateCableWithState> getEdgeList() {
 		return cableList;
 	}
-	public void setEdgeList(ArrayList<CableWithState> cableList) {
+	public void setEdgeList(ArrayList<IntermediateCableWithState> cableList) {
 		this.cableList = cableList;
 	}
 	public ArrayList<CpsNode> getNodeList() {

+ 4 - 4
src/ui/model/MinimumNetwork.java

@@ -5,15 +5,15 @@ import classes.HolonObject;
 
 public class MinimumNetwork {
 	private ArrayList<HolonObject> holonObjectList = new ArrayList<HolonObject>();
-	private ArrayList<CableWithState> edgeList = new ArrayList<CableWithState>();
-	public MinimumNetwork(ArrayList<HolonObject> holonObjectList, ArrayList<CableWithState> edgeList){
+	private ArrayList<IntermediateCableWithState> edgeList = new ArrayList<IntermediateCableWithState>();
+	public MinimumNetwork(ArrayList<HolonObject> holonObjectList, ArrayList<IntermediateCableWithState> edgeList){
 		this.holonObjectList = holonObjectList;
 		this.edgeList = edgeList;
 	}
 	public ArrayList<HolonObject> getHolonObjectList() {
 		return holonObjectList;
 	}
-	public ArrayList<CableWithState> getEdgeList() {
+	public ArrayList<IntermediateCableWithState> getEdgeList() {
 		return edgeList;
 	}
 	public String toString()
@@ -24,7 +24,7 @@ public class MinimumNetwork {
 		}
 		objecte += "]";
 		String edges = "[";
-		for(CableWithState edge :edgeList) {
+		for(IntermediateCableWithState edge :edgeList) {
 			edges += " " + edge.getModel();
 		}
 		edges += "]";

+ 17 - 17
src/ui/model/VisualRepresentationalState.java

@@ -11,9 +11,9 @@ import classes.AbstractCpsObject;
 import classes.CpsEdge;
 import classes.CpsNode;
 import classes.CpsUpperNode;
+import classes.IntermediateCalculationCable;
 import classes.ExitCable;
-import classes.ExitCableV2;
-import classes.ExitCableV2.ExitCableState;
+import classes.ExitCable.ExitCableState;
 
 public class VisualRepresentationalState {
 	private ArrayList<Supplier> supplierList = new ArrayList<Supplier>();
@@ -23,7 +23,7 @@ public class VisualRepresentationalState {
 	private ArrayList<DecoratedCable> cableList= new ArrayList<DecoratedCable>();
 	private ArrayList<DecoratedSwitch> switchList= new ArrayList<DecoratedSwitch>();
 	private ArrayList<DecoratedGroupNode> groupNodeList= new ArrayList<DecoratedGroupNode>();
-	private ArrayList<ExitCableV2> exitCableList= new ArrayList<ExitCableV2>();
+	private ArrayList<ExitCable> exitCableList= new ArrayList<ExitCable>();
 	
 	//ForFastAccessIndividualGroupNodes:
 	private HashMap<CpsUpperNode, DecoratedGroupNode> createdGroupNodes;
@@ -62,7 +62,7 @@ public class VisualRepresentationalState {
 		HashMap<CpsEdge, CpsUpperNode> inGroupEdges = minimumModel.getInGroupEdges();
 		createdGroupNodes =  new HashMap<CpsUpperNode, DecoratedGroupNode>();
 		
-		ArrayList<ExitCable> exitCables = new ArrayList<ExitCable>();
+		ArrayList<IntermediateCalculationCable> exitCables = new ArrayList<IntermediateCalculationCable>();
 		//createThem
 		for(CpsUpperNode groupNode :  minimumModel.getUppderNodeList()) {
 			createdGroupNodes.put(groupNode, new DecoratedGroupNode(groupNode));
@@ -127,7 +127,7 @@ public class VisualRepresentationalState {
 		for(DecoratedGroupNode dGroupNode: getGroupNodeList()) {
 			addTreeNode(root, dGroupNode, 1, fastaccess);
 		}
-		for(ExitCable cable : exitCables) {
+		for(IntermediateCalculationCable cable : exitCables) {
 			createExitEdgesV2(root,cable.getCable() , cable.getInsideObject(),cable.getInsideUpperNode(),cable.getOusideObject(),cable.getOutsideUpperNode(), fastaccess);			
 		}
 	}
@@ -185,7 +185,7 @@ public class VisualRepresentationalState {
 		}
 		for(NodeInfo info: infoList) {
 			DecoratedGroupNode group = this.createdGroupNodes.get(info.groupNode);
-			ArrayList<ExitCableV2> mylist;
+			ArrayList<ExitCable> mylist;
 			if(group == null) {
 				mylist = this.getExitCableList();
 			}else{
@@ -195,33 +195,33 @@ public class VisualRepresentationalState {
 			if(info.previous == Info.Nothing) {
 				if(info.next == Info.Child) {
 					state = ExitCableState.DOWN;
-					mylist.add(new ExitCableV2(state, insideObject, info.nextGroupNode, cable));
+					mylist.add(new ExitCable(state, insideObject, info.nextGroupNode, cable));
 				}else if(info.next == Info.Parent) {
 					state = ExitCableState.UP;
-					mylist.add(new ExitCableV2(state, insideObject, ousideObject, cable));
+					mylist.add(new ExitCable(state, insideObject, ousideObject, cable));
 				}else {
 					System.out.println("Error in VisualState");
 				}
 			}else if(info.previous == Info.Child) {
 				if(info.next == Info.Child) {
 					state = ExitCableState.DOWNDOWN;
-					mylist.add(new ExitCableV2(state, info.previousGroupNode, info.nextGroupNode, cable));
+					mylist.add(new ExitCable(state, info.previousGroupNode, info.nextGroupNode, cable));
 				}else if(info.next == Info.Parent) {
 					state = ExitCableState.DOWNUP;
-					mylist.add(new ExitCableV2(state, info.previousGroupNode, ousideObject, cable));
+					mylist.add(new ExitCable(state, info.previousGroupNode, ousideObject, cable));
 				}else {
 					state = ExitCableState.DOWN;
-					mylist.add(new ExitCableV2(state, info.previousGroupNode, ousideObject, cable));
+					mylist.add(new ExitCable(state, info.previousGroupNode, ousideObject, cable));
 				}
 			}else {//(info.previous == Info.Parent)
 				if(info.next == Info.Child) {
 					state = ExitCableState.DOWNUP;
-					mylist.add(new ExitCableV2(state, info.nextGroupNode, insideObject, cable));
+					mylist.add(new ExitCable(state, info.nextGroupNode, insideObject, cable));
 				}else if(info.next == Info.Parent) {
 					System.out.println("Error in VisualState");
 				}else {
 					state = ExitCableState.UP;
-					mylist.add(new ExitCableV2(state, ousideObject, insideObject, cable));
+					mylist.add(new ExitCable(state, ousideObject, insideObject, cable));
 				}
 			}
 		}
@@ -253,7 +253,7 @@ public class VisualRepresentationalState {
 
 
 	private void addCable(HashMap<AbstractCpsObject, CpsUpperNode> inGroupObjects, DecoratedCable cable,
-			DecoratedGroupNode groupNodeFromObject,ArrayList<ExitCable> exitCables) {
+			DecoratedGroupNode groupNodeFromObject,ArrayList<IntermediateCalculationCable> exitCables) {
 		if(groupNodeFromObject != null) {
 			boolean isIntern = inGroupObjects.get(cable.getModel().getA()) == inGroupObjects.get(cable.getModel().getB()); //Case null == null is not possible trough before Filtering MinimumModel#addUpperObjects(CpsUpperNode)
 			if(isIntern) {
@@ -261,10 +261,10 @@ public class VisualRepresentationalState {
 			}else {
 				if(inGroupObjects.get(cable.getModel().getA()) == groupNodeFromObject.getModel() && inGroupObjects.get(cable.getModel().getB()) != groupNodeFromObject.getModel()) {					
 					//addToGroupNode(new ExitCable(cable, groupNodeFromObject.getModel(),inGroupObjects.get(cable.getModel().getB()), cable.getModel().getA(), cable.getModel().getB()), groupNodeFromObject.getExitCableList());		
-					exitCables.add(new ExitCable(cable, groupNodeFromObject.getModel(),inGroupObjects.get(cable.getModel().getB()), cable.getModel().getA(), cable.getModel().getB()));
+					exitCables.add(new IntermediateCalculationCable(cable, groupNodeFromObject.getModel(),inGroupObjects.get(cable.getModel().getB()), cable.getModel().getA(), cable.getModel().getB()));
 				}else if(inGroupObjects.get(cable.getModel().getA()) != groupNodeFromObject.getModel() && inGroupObjects.get(cable.getModel().getB()) == groupNodeFromObject.getModel()) {					
 					//addToGroupNode(new ExitCable(cable, groupNodeFromObject.getModel(),inGroupObjects.get(cable.getModel().getA()), cable.getModel().getB(), cable.getModel().getA()), groupNodeFromObject.getExitCableList());		
-					exitCables.add(new ExitCable(cable, groupNodeFromObject.getModel(),inGroupObjects.get(cable.getModel().getA()), cable.getModel().getB(), cable.getModel().getA()));
+					exitCables.add(new IntermediateCalculationCable(cable, groupNodeFromObject.getModel(),inGroupObjects.get(cable.getModel().getA()), cable.getModel().getB(), cable.getModel().getA()));
 				}
 			}
 		}
@@ -352,7 +352,7 @@ public class VisualRepresentationalState {
 	}
 
 
-	public ArrayList<ExitCableV2> getExitCableList() {
+	public ArrayList<ExitCable> getExitCableList() {
 		return exitCableList;
 	}
 }

+ 3 - 3
src/ui/view/MyCanvas.java

@@ -7,7 +7,7 @@ import com.google.gson.JsonParseException;
 
 import ui.controller.Control;
 import ui.controller.UpdateController;
-import ui.model.CableWithState;
+import ui.model.IntermediateCableWithState;
 import ui.model.Consumer;
 import ui.model.DecoratedCable;
 import ui.model.DecoratedGroupNode;
@@ -440,7 +440,7 @@ public class MyCanvas extends AbstractCanvas implements MouseListener,
 		drawCanvasObject(g, dSwitch.getState() == SwitchState.Open ? HolonSwitch.getSwitchOpenImage(): HolonSwitch.getSwitchClosedImage() , dSwitch.getModel().getPosition());
 	}
 	
-	private void paintExitCable(Graphics2D g, ExitCableV2 eCable) {
+	private void paintExitCable(Graphics2D g, ExitCable eCable) {
 		Position start = eCable.getStart().getPosition();
 		Position end = eCable.getFinish().getPosition();
 		float currentEnergy = eCable.getCable().getFlowEnergy();
@@ -567,7 +567,7 @@ public class MyCanvas extends AbstractCanvas implements MouseListener,
 		
 		VisualRepresentationalState  visualState = controller.getSimManager().getActualVisualRepresentationalState();
 		//VisualState Representation:
-		for(ExitCableV2 cable : visualState.getExitCableList()) {
+		for(ExitCable cable : visualState.getExitCableList()) {
 			paintExitCable(g2d, cable);
 		}
 		for(DecoratedCable cable : visualState.getCableList()) {

+ 2 - 2
src/ui/view/UpperNodeCanvas.java

@@ -431,7 +431,7 @@ public class UpperNodeCanvas extends AbstractCanvas implements MouseListener, Mo
 		g.fillRect(pos.x - controller.getScaleDiv2(), pos.y - controller.getScaleDiv2(), controller.getScale(), controller.getScale());
 		drawCanvasObject(g, "/Images/upper_node.png" , pos);
 	}
-	private void paintExitCable(Graphics2D g, ExitCableV2 eCable) {
+	private void paintExitCable(Graphics2D g, ExitCable eCable) {
 		Position start = eCable.getStart().getPosition();
 		Position end = eCable.getFinish().getPosition();
 		float currentEnergy = eCable.getCable().getFlowEnergy();
@@ -549,7 +549,7 @@ public class UpperNodeCanvas extends AbstractCanvas implements MouseListener, Mo
 		
 		DecoratedGroupNode  actualGroupNode = controller.getSimManager().getActualVisualRepresentationalState().getCreatedGroupNodes().get(upperNode);
 		//VisualState Representation:
-		for(ExitCableV2 cable : actualGroupNode.getExitCableList()) {
+		for(ExitCable cable : actualGroupNode.getExitCableList()) {
 			paintExitCable(g2d, cable);
 		}
 		for(DecoratedCable cable : actualGroupNode.getInternCableList()) {