Procházet zdrojové kódy

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/carlos.garcia/praktikum-holons

# Conflicts:
#	src/ui/controller/StoreController.java
Teh-Hai Julian Zheng před 7 roky
rodič
revize
158defbb8e

+ 9 - 1
src/classes/TrackedDataSet.java

@@ -18,7 +18,15 @@ public class TrackedDataSet {
 	public static final int PERCENT_PARTIAL_SUPPLIED = 8;
 	public static final int GROUP_PRODUCTION = 9;
 	public static final int GROUP_CONSUMPTION = 10;
-	public static final int AMOUNT_SUBNETS = 11;
+	public static final int AMOUNT_HOLONS = 11;
+	public static final int AMOUNT_CLOSED_SWITCHES = 12;
+	public static final int AVG_AMOUNT_OBJECTS_IN_HOLONS = 13;
+	public static final int AVG_AMOUNT_ELEMENTS_IN_HOLONS = 14;
+	public static final int AVG_AMOUNT_PRODUCERS_IN_HOLONS = 15;
+	public static final int AVG_CONSUMED_ENERGY_IN_HOLONS = 16;
+	public static final int AVG_WASTED_ENERGY_IN_HOLONS = 17;
+	public static final int AMOUNT_BROKEN_EDGES = 18;
+	public static final int RATIO_PRODUCERS_CONSUMERS = 19;
 	
 	//Variables of the Data Set
 	private AbstractCpsObject cps;

+ 4 - 0
src/ui/controller/StoreController.java

@@ -20,6 +20,10 @@ import com.google.gson.stream.JsonWriter;
 
 import TypeAdapter.AbstractCpsObjectAdapter;
 import TypeAdapter.ColorAdapter;
+<<<<<<< HEAD
+=======
+
+>>>>>>> f4856be8f5b4727747723ac10f9568abad338792
 import TypeAdapter.PositionAdapter;
 
 import classes.Category;

+ 2 - 3
src/ui/view/GUI.java

@@ -128,7 +128,7 @@ public class GUI<E> implements CategoryListener {
 	private String catOfObjToBeEdited;
 	private final JScrollPane statTab = new JScrollPane();
 
-	private splitPane statSplitPane;
+	private SplitPane statSplitPane;
 	private JScrollPane statScrollPane;
 	private UpperNodeCanvas unc;
 	private JPanel contentPane;
@@ -282,7 +282,7 @@ public class GUI<E> implements CategoryListener {
 	public GUI(Control control) {
 		this.controller = control;
 		this.model = control.getModel();
-		statSplitPane = new splitPane(controller);
+		statSplitPane = new SplitPane(controller);
 		model.addGraphListener(statSplitPane);
 		statScrollPane = new JScrollPane(statSplitPane);
 		this.canvas = new MyCanvas(model, control);
@@ -1313,7 +1313,6 @@ public class GUI<E> implements CategoryListener {
 					elementGraph.setText(Languages.getLanguage()[25]);
 				}
 				temp = updCon.getActualCps();
-				System.out.println(temp);
 				// Erase old data in the PropertyTable
 				if (model.getPropertyTable().getRowCount() > 0) {
 					for (int i = model.getPropertyTable().getRowCount() - 1; i > -1; i--) {

+ 3 - 3
src/ui/view/splitPane.java → src/ui/view/SplitPane.java

@@ -55,7 +55,7 @@ import javax.swing.BoxLayout;
 import java.awt.FlowLayout;
 import java.awt.BorderLayout;
 
-public class splitPane extends JSplitPane implements GraphListener {
+public class SplitPane extends JSplitPane implements GraphListener {
 	
 	// Property Strings
 	public static final String TOT_PROD_HOLON = "total Holon Production";
@@ -103,7 +103,7 @@ public class splitPane extends JSplitPane implements GraphListener {
 	JLabel showObjectlbl;
 	JLabel showPropertylbl;
 
-	public splitPane(Control cont) {
+	public SplitPane(Control cont) {
 		this.controller = cont;
 		objectHashtable = new Hashtable<String, GraphDataSet>();
 		graphHashtable = new Hashtable<String, StatisticGraphPanel>();
@@ -129,7 +129,7 @@ public class splitPane extends JSplitPane implements GraphListener {
 		propValTable.put(PART_SUPPLIED_OBJ, TrackedDataSet.PERCENT_PARTIAL_SUPPLIED);
 		propValTable.put(TOT_PROD_GRID, TrackedDataSet.GROUP_PRODUCTION);
 		propValTable.put(TOT_CONS_GRID, TrackedDataSet.GROUP_CONSUMPTION);
-		propValTable.put(NR_SUBNETS, TrackedDataSet.AMOUNT_SUBNETS);
+		propValTable.put(NR_SUBNETS, TrackedDataSet.AMOUNT_HOLONS);
 
 		JScrollPane dataPane = new JScrollPane();
 		setLeftComponent(dataPane);

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

@@ -109,7 +109,7 @@ public class StatisticGraph extends JPanel {
 				case TrackedDataSet.ACTIVATED_ELEMENTS:
 				case TrackedDataSet.TOTAL_PRODUCTION:
 				case TrackedDataSet.TOTAL_CONSUMPTION:
-				case TrackedDataSet.AMOUNT_SUBNETS:
+				case TrackedDataSet.AMOUNT_HOLONS:
 				case TrackedDataSet.GROUP_CONSUMPTION:
 				case TrackedDataSet.GROUP_PRODUCTION:
 					createPathFloats(set);
@@ -229,7 +229,7 @@ public class StatisticGraph extends JPanel {
 				val = getMaxTotalConsumption(((CpsUpperNode) set.getCpsObject()).getNodes());
 				val *= -1;
 				break;
-			case TrackedDataSet.AMOUNT_SUBNETS:
+			case TrackedDataSet.AMOUNT_HOLONS:
 				val = controller.getSimManager().getSubNets().size();
 				for (int i = 0; i < model.getCurIteration(); i++) {
 					if (val < set.getValues()[i]) {
@@ -323,7 +323,7 @@ public class StatisticGraph extends JPanel {
 				set.setValAt(-getTotalConsumptionAt(((CpsUpperNode) set.getCpsObject()).getNodes(), model.getCurIteration()),
 						model.getCurIteration());
 				break;
-			case TrackedDataSet.AMOUNT_SUBNETS:
+			case TrackedDataSet.AMOUNT_HOLONS:
 				set.setValAt(controller.getSimManager().getSubNets().size(), model.getCurIteration());
 				break;
 			default:

+ 1 - 1
src/ui/view/StatisticGraphPanel.java

@@ -187,7 +187,7 @@ public class StatisticGraphPanel extends JPanel {
 		case TrackedDataSet.PERCENT_PARTIAL_SUPPLIED:
 			property = "Percentage of partial supplied";
 			break;
-		case TrackedDataSet.AMOUNT_SUBNETS:
+		case TrackedDataSet.AMOUNT_HOLONS:
 			property = "Amount of Subnets";
 			break;
 		default: