Rolf Egert 6 years ago
parent
commit
6b4f5e4201

+ 2 - 2
src/psoAlgoCode/Function.java

@@ -19,7 +19,7 @@ public class Function {
 		type = 0;
 	}
 
-	public void setParameters(Object obj) {
+	/*public void setParameters(Object obj) {
 		if (obj.getClass().equals(Boolean.class)) {
 			name = "Boolean function";
 			// upperLimit = 500;
@@ -42,7 +42,7 @@ public class Function {
 			type = 1;
 		}
 
-	}
+	}*/
 
 	public double execute(Particle p, int index, Model model, Control control) {
 		double result = 0.0;

+ 12 - 0
src/psoAlgoCode/HelpFunctions.java

@@ -25,6 +25,10 @@ public class HelpFunctions {
 		repairAllEdgesOnMainCanvas(model);
 	}
 
+	/**
+	 * Just a helper to avoid problems with destroyed edges etc..
+	 * @param model
+	 */
 	private static void repairAllEdgesOnMainCanvas(Model model) {
 		for (AbstractCpsObject obj : model.getObjectsOnCanvas()) {
 			if (obj instanceof CpsUpperNode) {
@@ -36,6 +40,10 @@ public class HelpFunctions {
 		}
 	}
 
+	/**
+	 * Repair function for Groupnodes.... Should all be handled in a single function if necessary.
+	 * @param uNode
+	 */
 	private static void repairAllEdgesInUpperNode(CpsUpperNode uNode) {
 		for (AbstractCpsObject obj : uNode.getNodes()) {
 			if (obj instanceof CpsUpperNode) {
@@ -56,6 +64,10 @@ public class HelpFunctions {
 		sim.calculateStateForTimeStep(model.getCurIteration());
 	}
 	
+	/**
+	 * Another anoying helperfunction which should be part of the general HOLEG functionalities
+	 * @return
+	 */
 	public static ArrayList<SubNet> getCurrentSubnets(){
 		return sim.getSubNets();
 	}

+ 5 - 0
src/psoAlgoCode/LineChart.java

@@ -18,6 +18,11 @@ import org.jfree.data.xy.XYDataset;
 import org.jfree.data.xy.XYSeries;
 import org.jfree.data.xy.XYSeriesCollection;
 
+/**
+ * COmpletely unnecessary if not used anymore in the new Version
+ * @author egert.rolf
+ *
+ */
 public class LineChart extends JDialog {
 
 	private static final long serialVersionUID = 1L;

+ 8 - 8
src/psoAlgoCode/SimplePSO.java

@@ -45,7 +45,7 @@ public class SimplePSO {
 	 * Initiate the swarm with random values depending on the type of calculate
 	 * (boolean or doubles)
 	 */
-	private void initSwarmRandom() {
+	/*private void initSwarmRandom() {
 		for (int i = 0; i < Constants.SWARM_SIZE; i++) {
 			Particle p = new Particle(Constants.DIMENSIONS);
 			Coordinate<Vector<Object>> tempPos = new Coordinate<Vector<Object>>();
@@ -59,7 +59,7 @@ public class SimplePSO {
 			swarm.addMember(p);
 		}
 		initCoeff();
-	}
+	}*/
 
 	private void initSwarm(Coordinate<Vector<Object>> startPos) {
 		for (int i = 0; i < Constants.SWARM_SIZE; i++) {
@@ -129,7 +129,7 @@ public class SimplePSO {
 		}
 	}
 
-	public void caclNextItSimplePSO(Model model, Control control, Coordinate<Vector<Object>> startPos) {
+/*	public void caclNextItSimplePSO(Model model, Control control, Coordinate<Vector<Object>> startPos) {
 		initSwarm(startPos);
 		runFunction(model, control);
 		evaluate();
@@ -149,7 +149,7 @@ public class SimplePSO {
 
 		evaluate();
 		iterations++;
-	}
+	}*/
 
 	/**
 	 * The boolean-based function to update the velocity of a particle depending on
@@ -354,7 +354,7 @@ public class SimplePSO {
 		return iterations;
 	}
 
-	private Coordinate<Vector<Object>> updateVelAdv(Coordinate<Vector<Object>> vel, Coordinate<Vector<Object>> pos,
+	/*private Coordinate<Vector<Object>> updateVelAdv(Coordinate<Vector<Object>> vel, Coordinate<Vector<Object>> pos,
 			Coordinate<Vector<Object>> bestLocal, int index) {
 		Coordinate<Vector<Object>> result = new Coordinate<Vector<Object>>();
 		for (int dim = 0; dim < Constants.DIMENSIONS; dim++) {
@@ -387,9 +387,9 @@ public class SimplePSO {
 			result.setCoord(newCoord, dim);
 		}
 		return result;
-	}
+	}*/
 
-	private Coordinate<Vector<Object>> updatePosAdv(Coordinate<Vector<Object>> vel, Coordinate<Vector<Object>> pos) {
+	/*private Coordinate<Vector<Object>> updatePosAdv(Coordinate<Vector<Object>> vel, Coordinate<Vector<Object>> pos) {
 		Coordinate<Vector<Object>> newPos = new Coordinate<Vector<Object>>();
 		for (int dim = 0; dim < Constants.DIMENSIONS; dim++) {
 			Vector<Object> newCoord = new Vector<Object>();
@@ -408,6 +408,6 @@ public class SimplePSO {
 			newPos.setCoord(newCoord, dim);
 		}
 		return newPos;
-	}
+	}*/
 
 }