Browse Source

small stuf

Rolf Egert 6 years ago
parent
commit
54b96312be
3 changed files with 14 additions and 20 deletions
  1. 6 12
      src/psoAlgoCode/LineChart.java
  2. 3 3
      src/psoAlgoCode/PSO.java
  3. 5 5
      src/psoAlgoCode/SimulateSimulator.java

+ 6 - 12
src/psoAlgoCode/LineChart.java

@@ -10,13 +10,7 @@ import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JPanel;
 
-import org.jfree.chart.ChartFactory;
-import org.jfree.chart.ChartPanel;
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.plot.PlotOrientation;
-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
@@ -26,9 +20,9 @@ import org.jfree.data.xy.XYSeriesCollection;
 public class LineChart extends JDialog {
 
 	private static final long serialVersionUID = 1L;
-	XYSeriesCollection collections = new XYSeriesCollection();
+//	XYSeriesCollection collections = new XYSeriesCollection();
 
-	public LineChart(String applicationTitle, String chartTitle) {
+	/*public LineChart(String applicationTitle, String chartTitle) {
 		JPanel chartPanel = plotStuff(chartTitle);
 		JPanel bottomPanel = new JPanel();
 		setTitle(applicationTitle);
@@ -49,8 +43,8 @@ public class LineChart extends JDialog {
 		});
 		bottomPanel.add(close);
 	}
-
-	public JPanel plotStuff(String chartTitle) {
+*/
+/*	public JPanel plotStuff(String chartTitle) {
 		XYDataset dataset = collections;
 		JFreeChart lineChart = ChartFactory.createXYLineChart(chartTitle, "Iterations", "Global Best", dataset,
 				PlotOrientation.VERTICAL, false, true, false);
@@ -66,5 +60,5 @@ public class LineChart extends JDialog {
 		}
 		collections.addSeries(series);
 	}
-
+*/
 }

+ 3 - 3
src/psoAlgoCode/PSO.java

@@ -202,8 +202,8 @@ public class PSO implements CpsAlgorithm {
 		phiText.setBounds(20, 135, 100, 20);
 		final JLabel iteration = new JLabel();
 		iteration.setBounds(20, 185, 110, 20);
-		JLabel counterIt = new JLabel();
-		counterIt.setBounds(135, 185, 50, 20);
+		JLabel counterIt = new JLabel("Repetitions:");
+		counterIt.setBounds(20, 155, 110, 20);
 		JLabel infoGraph = new JLabel("Show Diagnostic:");
 		infoGraph.setBounds(200, 60, 110, 20);
 		JLabel infoText1 = new JLabel(
@@ -305,7 +305,7 @@ public class PSO implements CpsAlgorithm {
 				phiIn.setBackground(Color.WHITE);
 			}
 		});
-		runs.setBounds(125, 150, 50, 20);
+		runs.setBounds(125, 155, 50, 20);
 		runs.setColumns(10);
 
 		// Buttons

+ 5 - 5
src/psoAlgoCode/SimulateSimulator.java

@@ -64,14 +64,14 @@ public class SimulateSimulator {
 		/**
 		 * Some state reset stuff, seems to be very unnecessary.... COMMENT THIS IN IF STRANGE CALCULATION STUFF HAPPENS
 		 */
-		/*for (SubNet singleSubNet : subNets) {
+		for (SubNet singleSubNet : subNets) {
 			if (singleSubNet.getObjects().size() == 0) {
 				resetConnections(singleSubNet.getBatteries().get(0), new ArrayList<>(), new ArrayList<>());
 			} else {
 				resetConnections(singleSubNet.getObjects().get(0), new ArrayList<>(), new ArrayList<>());
 			}
 
-		}*/
+		}
 		for (SubNet singleSubNet : subNets) {
 			float production = calculateEnergyWithoutFlexDevices("prod", singleSubNet, timeStep);
 			float consumption = calculateEnergyWithoutFlexDevices("cons", singleSubNet, timeStep);
@@ -782,9 +782,9 @@ public class SimulateSimulator {
 	/**
 	 * Get broken Edges
 	 */
-	// public ArrayList<CpsEdge> getBrokenEdges() {
-	// return brokenEdges;
-	// }
+	 public ArrayList<CpsEdge> getBrokenEdges() {
+	 return brokenEdges;
+	 }
 
 	/**
 	 * checks whether a given object is connected to an object inside the upperNode.