Browse Source

all Classes in classes checked witch checkstyle

Kevin Trometer 7 years ago
parent
commit
58a811001e

+ 1 - 1
.checkstyle

@@ -4,7 +4,7 @@
   <local-check-config name="Checkstyle_BP" location="/home/jessey/Downloads/Checkstyle_BP" type="external" description="">
     <additional-data name="protect-config-file" value="false"/>
   </local-check-config>
-  <fileset name="all" enabled="true" check-config-name="Checkstyle_BP" local="true">
+  <fileset name="all" enabled="true" check-config-name="BP Configuration" local="false">
     <file-match-pattern match-pattern="." include-pattern="true"/>
   </fileset>
 </fileset-config>

+ 5 - 5
src/API/CpsAPI.java

@@ -7,7 +7,7 @@ import classes.CpsEdge;
 import classes.AbstractCpsObject;
 import classes.HolonObject;
 import classes.HolonSwitch;
-import classes.subNet;
+import classes.SubNet;
 import ui.controller.Control;
 import ui.controller.SimulationManager;
 
@@ -24,7 +24,7 @@ public class CpsAPI {
 	 * a SubNet contains all Components
 	 * @return all SubNets on Canvas
 	 */
-	public ArrayList<subNet> getSubNets(){
+	public ArrayList<SubNet> getSubNets(){
 		simManager.searchForSubNets();
 		return simManager.getSubNets();
 	}
@@ -44,7 +44,7 @@ public class CpsAPI {
 	 */
 	public ArrayList<CpsEdge> getAllEdges(){
 		ArrayList<CpsEdge> result = new ArrayList<CpsEdge>();
-		for(subNet sN: getSubNets()){
+		for(SubNet sN: getSubNets()){
 			result.addAll(sN.getEdges());
 		}
 		return result;
@@ -56,7 +56,7 @@ public class CpsAPI {
 	 */
 	public ArrayList<HolonSwitch> getAllSwitches(){
 		ArrayList<HolonSwitch> result = new ArrayList<HolonSwitch>();
-		for(subNet sN: getSubNets()){
+		for(SubNet sN: getSubNets()){
 			result.addAll(sN.getSwitches());
 		}
 		return result;
@@ -64,7 +64,7 @@ public class CpsAPI {
 	
 	public ArrayList<HolonObject> getAllHolonObjects(){
 		ArrayList<HolonObject> result = new ArrayList<HolonObject>();
-		for(subNet sN: getSubNets()){
+		for(SubNet sN: getSubNets()){
 			result.addAll(sN.getObjects());
 		}
 		return result;

+ 36 - 32
src/classes/HolonElement.java

@@ -6,7 +6,7 @@ import ui.model.idCounterElem;
 
 /**
  * The class "HolonElement" represents any possible element that can be added to
- * a CpsObject (such as TV (consumer) or any energy source/producer)
+ * a CpsObject (such as TV (consumer) or any energy source/producer).
  * 
  * @author Gruppe14
  *
@@ -43,7 +43,7 @@ public class HolonElement {
 
 	/**
 	 * Create a new HolonElement with a user-defined name, amount of the same
-	 * element and energy per element
+	 * element and energy per element.
 	 * 
 	 * @param eleName
 	 *            String
@@ -63,9 +63,10 @@ public class HolonElement {
 	}
 
 	/**
-	 * Create a copy of the HolonElement given each one a new ID
+	 * Create a copy of the HolonElement given each one a new ID.
 	 * 
 	 * @param element
+	 *            element to copy
 	 */
 	public HolonElement(HolonElement element) {
 		setEleName(element.getEleName());
@@ -80,18 +81,18 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the Array of energy (100 values)
+	 * Get the Array of energy (100 values).
 	 * 
-	 * @return Array of floats
+	 * @return energyAt Array of Floats
 	 */
 	public float[] getEnergyAt() {
 		return energyAt;
 	}
 
 	/**
-	 * Set energy to any value to the whole array
+	 * Set energy to any value to the whole array.
 	 * 
-	 * @param energy,
+	 * @param energy
 	 *            the value
 	 */
 	public void setEnergyAt(float energy) {
@@ -101,7 +102,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set energy to any value at a given position
+	 * Set energy to any value at a given position.
 	 * 
 	 * @param pos
 	 *            int
@@ -113,7 +114,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the user-defined Name
+	 * Get the user-defined Name.
 	 * 
 	 * @return the name String
 	 */
@@ -122,7 +123,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the name to any new name
+	 * Set the name to any new name.
 	 * 
 	 * @param name
 	 *            the name to set
@@ -132,7 +133,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the actual amount of Elements in the selected Object
+	 * Get the actual amount of Elements in the selected Object.
 	 * 
 	 * @return the amount int
 	 */
@@ -141,7 +142,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the amount of the Element in the selected Object
+	 * Set the amount of the Element in the selected Object.
 	 * 
 	 * @param amount
 	 *            the amount to set
@@ -151,7 +152,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the energy value of the selected Element
+	 * Get the energy value of the selected Element.
 	 * 
 	 * @return the energy
 	 */
@@ -160,7 +161,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the energy value of the selected Element
+	 * Set the energy value of the selected Element.
 	 * 
 	 * @param energy
 	 *            the energy to set
@@ -170,7 +171,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the Status of the Element (see description of variables)
+	 * Get the Status of the Element (see description of variables).
 	 * 
 	 * @return the active
 	 */
@@ -179,7 +180,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the Status of the Element (see description of variables)
+	 * Set the Status of the Element (see description of variables).
 	 * 
 	 * @param active
 	 *            the active to set
@@ -189,7 +190,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get Image path
+	 * Get Image path.
 	 * 
 	 * @return the image
 	 */
@@ -198,7 +199,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set Image path
+	 * Set Image path.
 	 * 
 	 * @param image
 	 *            the image to set
@@ -210,7 +211,7 @@ public class HolonElement {
 	/**
 	 * Multiply the amount of gadgets, given by the user, and the
 	 * consumption/production. If the switch isWorking is turned off for on
-	 * gadget, the energy of this gadget have to be subtracted
+	 * gadget, the energy of this gadget have to be subtracted.
 	 * 
 	 * @return totalEnergy (actual)
 	 */
@@ -220,7 +221,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the energy value at a selected time x
+	 * Get the energy value at a selected time x.
 	 * 
 	 * @param x
 	 *            int
@@ -232,7 +233,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the symbol of the value (see variable description)
+	 * Get the symbol of the value (see variable description).
 	 * 
 	 * @return the sign
 	 */
@@ -241,7 +242,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set symbol of the value
+	 * Set symbol of the value.
 	 * 
 	 * @param energy
 	 *            the sign to set
@@ -254,14 +255,16 @@ public class HolonElement {
 	}
 
 	/**
-	 * @return the stored
+	 * @return the stored.
 	 */
 	public String getSav() {
 		return sav;
 	}
 
 	/**
-	 * @param stored
+	 * for save purposes.
+	 * 
+	 * @param sav
 	 *            the stored to set
 	 */
 	public void setSav(String sav) {
@@ -269,7 +272,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the actual object
+	 * Get the actual object.
 	 * 
 	 * @return the obj
 	 */
@@ -278,7 +281,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the object to a new one
+	 * Set the object to a new one.
 	 * 
 	 * @param obj
 	 *            the obj to set
@@ -288,7 +291,7 @@ public class HolonElement {
 	}
 
 	/**
-	 * Get the points (values) in the graph
+	 * Get the points (values) in the graph.
 	 * 
 	 * @return the Graph Points
 	 */
@@ -297,9 +300,9 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the points (values) in the graph
+	 * Set the points (values) in the graph.
 	 * 
-	 * @param points,
+	 * @param points
 	 *            the Graph points
 	 */
 	public void setGraphPoints(LinkedList<Point> points) {
@@ -307,18 +310,19 @@ public class HolonElement {
 	}
 
 	/**
-	 * Set the ID of the HolonElement (one time only)
+	 * Set the ID of the HolonElement (one time only).
 	 * 
 	 * @param id
+	 *            the id
 	 */
 	private void setId(int id) {
 		this.id = id;
 	}
 
 	/**
-	 * Get the Id of the selected HolonElement
+	 * Get the Id of the selected HolonElement.
 	 * 
-	 * @return
+	 * @return id the id
 	 */
 	public int getId() {
 		return id;

+ 50 - 44
src/classes/HolonObject.java

@@ -5,7 +5,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 
 import ui.controller.MultiPurposeController;
-import ui.model.idCounter;
 
 /**
  * The class HolonObject represents any Object on the system which capability of
@@ -24,7 +23,7 @@ public class HolonObject extends AbstractCpsObject {
 	/* Array of all consumers */
 	private ArrayList<HolonElement> elements;
 	/* Array of all Indices of Elements */
-	private HashMap<String, Integer> EleIdx;
+	private HashMap<String, Integer> eleIdx;
 	/* Total of consumption */
 	private float currentEnergy;
 
@@ -36,32 +35,19 @@ public class HolonObject extends AbstractCpsObject {
 	/**
 	 * Constructor Set by default the name of the object equals to the category
 	 * name, until the user changes it.
-	 */
-	public HolonObject(String ObjName) {
-		super(ObjName);
-		setElements(new ArrayList<HolonElement>());
-		setEleIdx(new HashMap<String, Integer>());
-		setState();
-	}
-
-	/**
-	 * Constructor with a user-defined name
 	 * 
-	 * @param ObjName
-	 *            Type of Object
-	 * @param obj
-	 *            user-defined name
+	 * @param objName
+	 *            name of the Object
 	 */
-	public HolonObject(String ObjName, String obj) {
-		super(ObjName);
-		super.setName(obj);
+	public HolonObject(String objName) {
+		super(objName);
 		setElements(new ArrayList<HolonElement>());
 		setEleIdx(new HashMap<String, Integer>());
 		setState();
 	}
 
 	/**
-	 * Contructor of a copy of an Object
+	 * Contructor of a copy of an Object.
 	 * 
 	 * @param obj
 	 *            object to be copied
@@ -74,8 +60,8 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * sets the State, wether object is a producer, zero Energy, supplied or not
-	 * supplied
+	 * sets the State, wether object is a producer, zero Energy, supplied or
+	 * not.
 	 */
 	public void setState() {
 		if (getCurrentEnergy() > 0) {
@@ -97,7 +83,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Getter for all Elements in the HolonObject
+	 * Getter for all Elements in the HolonObject.
 	 * 
 	 * @return the elements ArrayList
 	 */
@@ -106,7 +92,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set a new ArrayList with HolonElements into the HolonObject
+	 * Set a new ArrayList with HolonElements into the HolonObject.
 	 * 
 	 * @param elements
 	 *            the elements to set
@@ -115,13 +101,19 @@ public class HolonObject extends AbstractCpsObject {
 		this.elements = elements;
 	}
 
+	/**
+	 * add an Element to the Object.
+	 * 
+	 * @param element
+	 *            the Element to add
+	 */
 	public void addElements(HolonElement element) {
 		elements.add(element);
 	}
 
 	/**
 	 * Doesn't take into account which timestep is watched, calculates the max
-	 * values
+	 * values.
 	 * 
 	 * @return the currentEnergy
 	 */
@@ -137,7 +129,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Getter for the current energy at a given timestep
+	 * Getter for the current energy at a given timestep.
 	 * 
 	 * @param x
 	 *            timestep
@@ -155,7 +147,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * deletes Element at a given index
+	 * deletes Element at a given index.
 	 * 
 	 * @param idx
 	 *            index
@@ -165,7 +157,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * String of all consumers in this HolonObject
+	 * String of all consumers in this HolonObject.
 	 * 
 	 * @return all the names of this HolonObject separated by "," each object
 	 */
@@ -182,29 +174,30 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Getter index of all elements in the HolonObject
+	 * Getter index of all elements in the HolonObject.
 	 * 
 	 * @return the eleIdx
 	 */
 	public HashMap<String, Integer> getEleIdx() {
-		return EleIdx;
+		return eleIdx;
 	}
 
 	/**
-	 * Set the indexes of all elements
+	 * Set the indexes of all elements.
 	 * 
 	 * @param eleIdx
 	 *            the eleIdx to set
 	 */
 	public void setEleIdx(HashMap<String, Integer> eleIdx) {
-		EleIdx = eleIdx;
+		this.eleIdx = eleIdx;
 	}
 
 	/**
-	 * Copy all Elements into a New Array
+	 * Copy all Elements into a New Array.
 	 * 
 	 * @param arr
-	 * @return
+	 *            to copy
+	 * @return the copy of arr
 	 */
 	public ArrayList<HolonElement> copyElements(ArrayList<HolonElement> arr) {
 		ArrayList<HolonElement> newArr = new ArrayList<>();
@@ -215,23 +208,23 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Get the state of the Object
+	 * Get the state of the Object.
 	 * 
-	 * @return state
+	 * @return state the State of the Element
 	 */
 	public int getState() {
 		return this.state;
 	}
 
 	/**
-	 * Set the state of the Object
+	 * Set the state of the Object.
 	 * 
-	 * @param supplied
+	 * @param state
 	 *            boolean if the Object is fully supplied
 	 */
-	public void setState(int st) {
-		this.state = st;
-		switch (st) {
+	public void setState(int state) {
+		this.state = state;
+		switch (state) {
 		case 0:
 			stateColor = Color.WHITE;
 			break;
@@ -254,7 +247,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Search for the element with the name
+	 * Search for the element with the name.
 	 * 
 	 * @param name
 	 *            name of the object to be searched
@@ -271,7 +264,7 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
-	 * Search for the element with the id
+	 * Search for the element with the id.
 	 * 
 	 * @param id
 	 *            id of the element to be founded
@@ -288,9 +281,11 @@ public class HolonObject extends AbstractCpsObject {
 	}
 
 	/**
+	 * Check if Partially Supplied.
 	 * 
 	 * @param x
-	 * @return
+	 *            current Iteration
+	 * @return boolean is partially supplied
 	 */
 	public boolean checkIfPartiallySupplied(int x) {
 		if (getElements().size() == 0) {
@@ -318,10 +313,21 @@ public class HolonObject extends AbstractCpsObject {
 		}
 	}
 
+	/**
+	 * Set the State Color.
+	 * 
+	 * @param color
+	 *            the Color
+	 */
 	public void setColor(Color color) {
 		stateColor = color;
 	}
 
+	/**
+	 * Get the Color.
+	 * 
+	 * @return stateColor the Color
+	 */
 	public Color getColor() {
 		return stateColor;
 	}

+ 34 - 41
src/classes/HolonSwitch.java

@@ -3,6 +3,12 @@ package classes;
 import java.awt.Point;
 import java.util.LinkedList;
 
+/**
+ * The class HolonSwitch represents a Switch, which can be turned on and off.
+ * 
+ * @author Gruppe14
+ *
+ */
 public class HolonSwitch extends AbstractCpsObject {
 
 	/**
@@ -40,31 +46,13 @@ public class HolonSwitch extends AbstractCpsObject {
 
 	/**
 	 * Create a new HolonSwitch with the default name ("Switch"), a default
-	 * value of automatic handle and active status
+	 * value of automatic handle and active status.
 	 * 
-	 * @param ObjName
+	 * @param objName
 	 *            String
 	 */
-	public HolonSwitch(String ObjName) {
-		super(ObjName);
-		setManualState(true);
-		setAutoState(true);
-		setActiveAt(true);
-		setManualMode(false);
-	}
-
-	/**
-	 * Create a new HolonSwitch with user-defined name, a default value of
-	 * automatic handle and active status
-	 * 
-	 * @param ObjName
-	 *            String
-	 * @param obj
-	 *            String
-	 */
-	public HolonSwitch(String ObjName, String obj) {
-		super(ObjName);
-		super.setName(obj);
+	public HolonSwitch(String objName) {
+		super(objName);
 		setManualState(true);
 		setAutoState(true);
 		setActiveAt(true);
@@ -75,6 +63,7 @@ public class HolonSwitch extends AbstractCpsObject {
 	 * Create a copy of an existing HolonSwitch.
 	 * 
 	 * @param obj
+	 *            the Object to copy
 	 */
 	public HolonSwitch(AbstractCpsObject obj) {
 		super(obj);
@@ -86,7 +75,7 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Calculates the state of the Switch
+	 * Calculates the state of the Switch.
 	 */
 	public void switchState() {
 		if (manualMode) {
@@ -100,7 +89,7 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Getter for the status of the Switch at a given timestep
+	 * Getter for the status of the Switch at a given timestep.
 	 * 
 	 * @param timeStep
 	 *            int
@@ -115,9 +104,9 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Overall status of the switch (manual or automatic mode)
+	 * Overall status of the switch (manual or automatic mode).
 	 * 
-	 * @return
+	 * @return boolean the State
 	 */
 	public boolean getState() {
 		if (manualMode) {
@@ -129,9 +118,10 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Change the state of the Switch to manual
+	 * Change the state of the Switch to manual.
 	 * 
 	 * @param state
+	 *            the State
 	 */
 	public void setManualState(boolean state) {
 		this.manualActive = state;
@@ -139,9 +129,10 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set the state of the Switch to automatic
+	 * Set the state of the Switch to automatic.
 	 * 
 	 * @param state
+	 *            the State
 	 */
 	public void setAutoState(boolean state) {
 		this.autoActive = state;
@@ -149,7 +140,7 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set Image of the Switch
+	 * Set Image of the Switch.
 	 */
 	private void setImage() {
 		if (manualMode) {
@@ -168,7 +159,7 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * For automatic use only (throught the graph)
+	 * For automatic use only (throught the graph).
 	 * 
 	 * @return the Graph Points
 	 */
@@ -177,9 +168,9 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set the values of the switch in the graph (auto. mode only)
+	 * Set the values of the switch in the graph (auto. mode only).
 	 * 
-	 * @param points,
+	 * @param points
 	 *            the Graph points
 	 */
 	public void setGraphPoints(LinkedList<Point> points) {
@@ -188,25 +179,27 @@ public class HolonSwitch extends AbstractCpsObject {
 
 	/**
 	 * All values of the graph for the selected Switch (only auto-Mode) get the
-	 * activeAt Array
+	 * activeAt Array.
+	 * 
+	 * @return boolean[] the States of each Iteration
 	 */
 	public boolean[] getActiveAt() {
 		return activeAt;
 	}
 
 	/**
-	 * Overall value of the Swtich (only manual-Mode)
+	 * Returns the ManualState.
 	 * 
-	 * @return
+	 * @return boolean Manual State
 	 */
 	public boolean getActiveManual() {
 		return this.manualActive;
 	}
 
 	/**
-	 * Set the value of the Switch
+	 * Set the value of the Switch.
 	 * 
-	 * @param active,
+	 * @param active
 	 *            the default value
 	 */
 	public void setActiveAt(boolean active) {
@@ -216,18 +209,18 @@ public class HolonSwitch extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set the overall value of the Switch (manual mode)
+	 * Set the overall value of the Switch (manual mode).
 	 * 
-	 * @param mode
+	 * @param mode the mode (boolean)
 	 */
 	public void setManualMode(boolean mode) {
 		manualMode = mode;
 	}
 
 	/**
-	 * Get the value of the switch (manual mode)
+	 * Get manualmode state.
 	 * 
-	 * @return
+	 * @return boolean manual mode state
 	 */
 	public boolean getManualMode() {
 		return manualMode;

+ 26 - 13
src/classes/HolonTransformer.java

@@ -1,5 +1,11 @@
 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 */
@@ -14,17 +20,19 @@ public class HolonTransformer extends AbstractCpsObject {
 
 	/**
 	 * Constructor Set type of object (Transformer), its transform ratio and the
-	 * default name ("Transformer");
+	 * default name ("Transformer").
+	 * 
+	 * @param objName name for the Object
 	 */
-	public HolonTransformer(String ObjName) {
-		super(ObjName);
-	}
-
-	public HolonTransformer(String ObjName, String obj) {
-		super(ObjName);
-		super.setName(obj);
+	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());
@@ -32,7 +40,7 @@ public class HolonTransformer extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set transform ratio
+	 * Set transform ratio.
 	 * 
 	 * @param ratio
 	 *            desired ratio
@@ -42,7 +50,7 @@ public class HolonTransformer extends AbstractCpsObject {
 	}
 
 	/**
-	 * Output the actual ratio of the transformer
+	 * Output the actual ratio of the transformer.
 	 * 
 	 * @return actual ratio of the transformer
 	 */
@@ -51,7 +59,7 @@ public class HolonTransformer extends AbstractCpsObject {
 	}
 
 	/**
-	 * Set fixed Transform Value
+	 * Set fixed Transform Value.
 	 * 
 	 * @param fixed
 	 *            desired fixed Transform Value
@@ -61,7 +69,7 @@ public class HolonTransformer extends AbstractCpsObject {
 	}
 
 	/**
-	 * Output the actual fixed Transform Value
+	 * Output the actual fixed Transform Value.
 	 * 
 	 * @return actual fixed Transform Value
 	 */
@@ -69,6 +77,11 @@ public class HolonTransformer extends AbstractCpsObject {
 		return this.transformFixed;
 	}
 
+	/**
+	 * Get the Output of the Transformer.
+	 * 
+	 * @return The Output
+	 */
 	public float getOutput() {
 		float output = 0;
 		return output;

+ 3 - 3
src/classes/Position.java

@@ -1,7 +1,7 @@
 package classes;
 
 /**
- * Coordinates of an Object on the canvas with a (int) x-coord and a (int)
+ * Coordinates of an Object on the canvas with a (int) x-coord and a (int).
  * y-coord
  * 
  * @author Gruppe14
@@ -12,7 +12,7 @@ public class Position {
 	public int y;
 
 	/**
-	 * Constructor with an positive x and y coord on the canvas
+	 * Constructor with an positive x and y coord on the canvas.
 	 * 
 	 * @param x
 	 *            int
@@ -25,7 +25,7 @@ public class Position {
 	}
 
 	/**
-	 * Default constructor without defined position
+	 * Default constructor without defined position.
 	 */
 	public Position() {
 		this.x = -1;

+ 27 - 3
src/classes/subNet.java → src/classes/SubNet.java

@@ -8,25 +8,49 @@ import java.util.ArrayList;
  * @author Gruppe14
  *
  */
-public class subNet {
+public class SubNet {
 	private ArrayList<HolonObject> subNetObjects;
 	private ArrayList<CpsEdge> subNetEdges;
 	private ArrayList<HolonSwitch> subNetSwitches;
 
-	public subNet(ArrayList<HolonObject> objects, ArrayList<CpsEdge> edges, ArrayList<HolonSwitch> switches) {
+	/**
+	 * Constructor for a Subnet.
+	 * 
+	 * @param objects
+	 *            Objects in the Subnet
+	 * @param edges
+	 *            Edges in the Subnet
+	 * @param switches
+	 *            Switches in the Subnet
+	 */
+	public SubNet(ArrayList<HolonObject> objects, ArrayList<CpsEdge> edges, ArrayList<HolonSwitch> switches) {
 		subNetObjects = objects;
 		subNetEdges = edges;
 		subNetSwitches = switches;
 	}
 
+	/**
+	 * Return all Objects in the Subnet.
+	 * 
+	 * @return all Objects in the Subnet
+	 */
 	public ArrayList<HolonObject> getObjects() {
 		return subNetObjects;
 	}
-
+	/**
+	 * Return all Edges in the Subnet.
+	 * 
+	 * @return all Edges in the Subnet
+	 */
 	public ArrayList<CpsEdge> getEdges() {
 		return subNetEdges;
 	}
 
+	/**
+	 * Return all Switches in the Subnet.
+	 * 
+	 * @return all Switches in the Subnet
+	 */
 	public ArrayList<HolonSwitch> getSwitches() {
 		return subNetSwitches;
 	}

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

@@ -9,7 +9,7 @@ import classes.AbstractCpsObject;
 import classes.HolonElement;
 import classes.HolonObject;
 import classes.HolonSwitch;
-import classes.subNet;
+import classes.SubNet;
 import ui.model.Model;
 import ui.view.MyCanvas;
 
@@ -17,7 +17,7 @@ public class SimulationManager {
 	private Model model;
 	private ArrayList<AbstractCpsObject> objectsToHandle;
 	private ArrayList<CpsEdge> allConnections;
-	private ArrayList<subNet> subNets;
+	private ArrayList<SubNet> subNets;
 	private MyCanvas canvas;
 	private int timeStep;
 	private boolean simMode;
@@ -26,7 +26,7 @@ public class SimulationManager {
 	public SimulationManager(Model m) {
 		canvas = null;
 		model = m;
-		subNets = new ArrayList<subNet>();
+		subNets = new ArrayList<SubNet>();
 		simMode = model.getIsSimulation();
 	}
 
@@ -39,10 +39,10 @@ public class SimulationManager {
 		simMode = model.getIsSimulation();
 		timeStep = x;
 		searchForSubNets();
-		for (subNet singleSubNet : subNets) {
+		for (SubNet singleSubNet : subNets) {
 			ResetConnections(singleSubNet.getObjects().get(0), new ArrayList<Integer>(), new ArrayList<CpsEdge>());
 		}
-		for (subNet singleSubNet : subNets) {
+		for (SubNet singleSubNet : subNets) {
 			float production = calculateEnergy("prod", singleSubNet, timeStep);
 			float consumption = calculateEnergy("cons", singleSubNet, timeStep);
 			float minConsumption = calculateMinimumEnergy(singleSubNet, timeStep);
@@ -79,7 +79,7 @@ public class SimulationManager {
 		canvas.repaint();
 	}
 
-	public void setFlow(subNet sN, boolean simulation) {
+	public void setFlow(SubNet sN, boolean simulation) {
 		if (simulation) {
 			setFlowSimulation(sN);
 		} else {
@@ -87,7 +87,7 @@ public class SimulationManager {
 		}
 	}
 
-	public void setFlowModelation(subNet sN) {
+	public void setFlowModelation(SubNet sN) {
 		for (HolonObject hl : sN.getObjects()) {
 			float energy = hl.getCurrentEnergyAtTimeStep(timeStep);
 			if (energy > 0) {
@@ -99,7 +99,7 @@ public class SimulationManager {
 		}
 	}
 
-	public void setFlowSimulation(subNet sN) {
+	public void setFlowSimulation(SubNet sN) {
 		ArrayList<AbstractCpsObject> producers = new ArrayList<AbstractCpsObject>();
 		AbstractCpsObject tmp = null;
 		tagTable = new HashMap<Integer, Float>();
@@ -244,7 +244,7 @@ public class SimulationManager {
 	 * @param sN
 	 * @return
 	 */
-	public float calculateEnergy(String type, subNet sN, int x) {
+	public float calculateEnergy(String type, SubNet sN, int x) {
 		float energy = 0;
 		for (HolonObject hl : sN.getObjects()) {
 			if (type.equals("prod")) {
@@ -266,7 +266,7 @@ public class SimulationManager {
 		return energy;
 	}
 
-	public float calculateMinimumEnergy(subNet sN, int x) {
+	public float calculateMinimumEnergy(SubNet sN, int x) {
 		float min = 0;
 		float minElement = 0;
 		for (HolonObject hl : sN.getObjects()) {
@@ -287,14 +287,14 @@ public class SimulationManager {
 	 * generates all subNets from all objectsToHandle
 	 */
 	public void searchForSubNets() {
-		subNets = new ArrayList<subNet>();
+		subNets = new ArrayList<SubNet>();
 		boolean end = false;
 		int i = 0;
 		AbstractCpsObject cps;
 		if (objectsToHandle.size() > 0) {
 			while (!end) {
 				cps = objectsToHandle.get(i);
-				subNet singleSubNet = new subNet(new ArrayList<HolonObject>(), new ArrayList<CpsEdge>(),
+				SubNet singleSubNet = new SubNet(new ArrayList<HolonObject>(), new ArrayList<CpsEdge>(),
 						new ArrayList<HolonSwitch>());
 				singleSubNet = buildSubNet(cps, new ArrayList<Integer>(), singleSubNet);
 				if (singleSubNet.getObjects().size() != 0) {
@@ -316,7 +316,7 @@ public class SimulationManager {
 	 * @param sN
 	 * @return
 	 */
-	public subNet buildSubNet(AbstractCpsObject cps, ArrayList<Integer> visited, subNet sN) {
+	public SubNet buildSubNet(AbstractCpsObject cps, ArrayList<Integer> visited, SubNet sN) {
 		visited.add(cps.getID());
 		if (cps instanceof HolonObject) {
 			sN.getObjects().add((HolonObject) cps);
@@ -430,7 +430,7 @@ public class SimulationManager {
 		copyObjects(model.getObjectsOnCanvas());
 	}
 
-	public ArrayList<subNet> getSubNets() {
+	public ArrayList<SubNet> getSubNets() {
 		return subNets;
 	}