Browse Source

fixed everything

Kevin Trometer 8 years ago
parent
commit
1653d735ed

+ 32 - 1
src/classes/AbstractCpsObject.java

@@ -34,7 +34,9 @@ public abstract class AbstractCpsObject {
 	Color borderColor = Color.WHITE;
 	/* a Tag that can be used */
 	ArrayList<Integer> tags;
-
+	/* a Tag that can be used */
+	ArrayList<Integer> pseudoTags;
+	
 	/**
 	 * Constructor for a CpsObejct with an unique ID.
 	 * 
@@ -292,4 +294,33 @@ public abstract class AbstractCpsObject {
 	public void setTags(ArrayList<Integer> tags) {
 		this.tags = tags;
 	}
+
+	/**
+	 * For internal purpose (energy flow).
+	 * 
+	 * @param tags
+	 *            for internal purpose
+	 */
+	public void setPseudoTags(ArrayList<Integer> tags) {
+		this.pseudoTags= tags;
+	}
+	
+	/**
+	 * Get the pseudo tags.
+	 * 
+	 * @return ArrayList
+	 */
+	public ArrayList<Integer> getPseudoTags() {
+		return this.pseudoTags;
+	}
+	
+	/**
+	 * add a pseudo tag.
+	 * 
+	 * @return ArrayList
+	 */
+	public ArrayList<Integer> addPseudoTag() {
+		return this.pseudoTags;
+	}
+	
 }

+ 9 - 4
src/classes/CpsEdge.java

@@ -56,6 +56,8 @@ public class CpsEdge {
 	 *            Source
 	 * @param b
 	 *            Destination
+	 * @param maxCap
+	 *            Maximum Capacity
 	 */
 	public CpsEdge(AbstractCpsObject a, AbstractCpsObject b, float maxCap) {
 		setA(a);
@@ -105,7 +107,7 @@ public class CpsEdge {
 		this.flow = flow;
 		/**
 		 * if (flow <= maxCapacity || flow == -1) { isWorking = true; } else {
-		 * isWorking = false; state = false; }
+		 * isWorking = false; state = false;
 		 **/
 	}
 
@@ -113,6 +115,7 @@ public class CpsEdge {
 	 * Calculates the state of the edge (see description of isWorking).
 	 * 
 	 * @param simMode
+	 *            Simulation Mode
 	 */
 
 	public void calculateState(boolean simMode) {
@@ -167,6 +170,7 @@ public class CpsEdge {
 	 * Set the state manually to a new one.
 	 * 
 	 * @param state
+	 *            the state
 	 */
 	public void setState(boolean state) {
 		isWorking = state;
@@ -175,7 +179,7 @@ public class CpsEdge {
 	/**
 	 * Getter for the status.
 	 * 
-	 * @return
+	 * @return the state
 	 */
 	public boolean getState() {
 		return isWorking;
@@ -185,6 +189,7 @@ public class CpsEdge {
 	 * set the tags into a new set of tags.
 	 * 
 	 * @param tags
+	 *            tags for this edge
 	 */
 	public void setTags(ArrayList<Integer> tags) {
 		this.tags = tags;
@@ -193,7 +198,7 @@ public class CpsEdge {
 	/**
 	 * Getter for the ArrayList of tags.
 	 * 
-	 * @return
+	 * @return tags tags for this edge
 	 */
 	public ArrayList<Integer> getTags() {
 		return tags;
@@ -202,7 +207,7 @@ public class CpsEdge {
 	/**
 	 * Add a new tag to the ArrayList.
 	 * 
-	 * @param tag
+	 * @param tag tag for the ArrayList
 	 */
 	public void addTag(int tag) {
 		tags.add(tag);

+ 1 - 1
src/classes/CpsNode.java

@@ -14,7 +14,7 @@ import ui.model.idCounter;
 public class CpsNode extends AbstractCpsObject {
 
 	/**
-	 * Create a new node in the system with an user-defined name
+	 * Create a new node in the system with an user-defined name.
 	 * 
 	 * @param objName
 	 *            String

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

@@ -14,7 +14,7 @@ import ui.model.Model;
 import ui.view.MyCanvas;
 
 public class SimulationManager {
-	private Model model;cpsobjec
+	private Model model;
 	private ArrayList<AbstractCpsObject> objectsToHandle;
 	private ArrayList<CpsEdge> allConnections;
 	private ArrayList<subNet> subNets;