Browse Source

Changed Parameter of Topologie Objective Function

Troppmann, Tom 3 years ago
parent
commit
4dc7627a8d

BIN
exampleNetworks/Topologie_Version2.holon


BIN
exampleNetworks/test_topologie_result.holon


BIN
exampleNetworks/test_topologie_start.holon


+ 1 - 5
src/algorithm/objectiveFunction/GraphMetrics.java

@@ -386,11 +386,7 @@ public class GraphMetrics {
 		 double sum = 0.0;
 		 for(int s = 0; s < G.S.length; s++) {
 			 for(int t = s; t < G.S.length; t++) {
-				 try {
-					 sum += D[G.S[s].id][G.S[t].id];					 
-				 }catch(java.lang.ArrayIndexOutOfBoundsException E) {
-					 System.out.println(G);
-				 }
+				sum += D[G.S[s].id][G.S[t].id];					 
 			 }
 		 }
 		 //Returns the Average

+ 2 - 2
src/algorithm/objectiveFunction/ObjectiveFunctionByCarlos.java

@@ -128,8 +128,8 @@ public class ObjectiveFunctionByCarlos {
 		//calculate f_holon
 		double f_holon = 0;
 		for(DecoratedNetwork net : state.getNetworkList()) {
-			double f_elements_diviation_production = net.getDiviationInProductionInNetworkForHolonObjects();
-			double f_elements_diviation_consumption = net.getDiviationInProductionInNetworkForHolonObjects();
+			double f_elements_diviation_production = net.getDeviationInProductionInNetworkForHolonObjects();
+			double f_elements_diviation_consumption = net.getDeviationInProductionInNetworkForHolonObjects();
 			double f_flexibility_diviation_consumption = net.getDiviationInFlexibilityConsumption();
 			double f_flexibility_diviation_production = net.getDiviationInFlexibilityProduction();
 			

+ 13 - 18
src/algorithm/objectiveFunction/TopologieObjectiveFunction.java

@@ -15,7 +15,7 @@ public class TopologieObjectiveFunction {
 	//Parameters
 	
 	//weight for f_g(H)
-	static double w_eb = 0.2, w_max = 0.05, w_holon= 0.1, w_selection = .3, w_grid = 0.35;
+	static double w_eb = 0.3, w_max = 0.2, w_holon= 0.1, w_selection = .3, w_grid = 0.1;
 	
 	
 	//--> f_eb parameter
@@ -26,13 +26,13 @@ public class TopologieObjectiveFunction {
 	/**
 	 * Maximum when all on Energie Difference(kappa)
 	 */
-	static double k_max = 350000.f;
+	static double k_max = 450000.f;
 	
 	//--> f_holon parameter
 	/**
-	 * maximum penalty from holon flexibilities 
+	 * maximum penalty from holon element distribution
 	 */
-	static double k_holon= 220000;
+	static double k_holon= 100000;
 	
 	
 	//--> f_selection paramaeter;
@@ -50,13 +50,13 @@ public class TopologieObjectiveFunction {
 	/**
 	 * The avergae shortest path maximum length -> kappa for the squash function
 	 */
-	static double k_avg_shortest_path = 1650;
+	static double k_avg_shortest_path = 1600;
 	//Disjpijoint path cant have zero as output it starts with the value 1
 	static double centerValue_disjoint_path = 1.0; 
 	static double k_disjoint_path = 2.4;
 	static double lambda_avg_shortest_path = 10;
 	static double lambda_disjoint_path = 10;
-	static double k_grid = lambda_avg_shortest_path + lambda_disjoint_path;
+	static double k_grid = lambda_avg_shortest_path;// + lambda_disjoint_path;
 	
 	
 	
@@ -129,9 +129,9 @@ public class TopologieObjectiveFunction {
 		//calculate f_holon
 		double f_holon = 0;
 		for(DecoratedNetwork net : state.getNetworkList()) {
-			double f_elements_diviation_production = net.getDiviationInProductionInNetworkForHolonObjects();
-			double f_elements_diviation_consumption = net.getDiviationInProductionInNetworkForHolonObjects();
-			double f_element = f_elements_diviation_production+f_elements_diviation_consumption;
+			double f_elements_deviation_production = net.getDeviationInProductionInNetworkForHolonObjects();
+			double f_elements_deviation_consumption = net.getDeviationInConsumptionInNetworkForHolonObjects();
+			double f_element = f_elements_deviation_production+f_elements_deviation_consumption;
 			f_holon += f_element;
 		}
 		
@@ -179,13 +179,13 @@ public class TopologieObjectiveFunction {
 			Graph G = GraphMetrics.convertDecoratedNetworkToGraph(net);
 			//We have to penalize single Networks;
 			if(G.V.length <= 1 || G.S.length <= 1) {
-				f_grid += lambda_avg_shortest_path + lambda_disjoint_path;
+				f_grid += lambda_avg_shortest_path;// + lambda_disjoint_path;
 				continue;
 			}
 		
 			double avgShortestPath = GraphMetrics.averageShortestDistance(G);
-			double disjpointPaths = GraphMetrics.averageEdgeDisjointPathProblem(G);
-			f_grid += avgShortestPathPenalty(avgShortestPath) + disjoinPathPenalty(disjpointPaths);
+			//double disjpointPaths = GraphMetrics.averageEdgeDisjointPathProblem(G);
+			f_grid += avgShortestPathPenalty(avgShortestPath);// + disjoinPathPenalty(disjpointPaths);
 		}
 		//take average to encourage splitting
 		f_grid /= state.getNetworkList().size();
@@ -193,13 +193,8 @@ public class TopologieObjectiveFunction {
 		
 		
 		
-		//avg disjoint path in jeden holon von jedem zu jedem element
 		
-		
-		
-		
-		
-		printUnsquashedValues(f_eb, f_maximum, f_holon, f_selection, f_grid);
+		//printUnsquashedValues(f_eb, f_maximum, f_holon, f_selection, f_grid);
 		return (float) (w_eb * squash(f_eb, k_eb) 
 				+ w_max * squash(f_maximum, k_max) 
 				+ w_holon * squash(f_holon, k_holon) 

+ 1 - 1
src/api/TopologieAlgorithmFramework.java

@@ -59,7 +59,7 @@ import ui.view.Console;
 public abstract class TopologieAlgorithmFramework implements AddOn{
 	//Algo
 	protected int rounds = 1;
-	protected int amountOfNewCables = 50;
+	protected int amountOfNewCables = 20;
 	
 	
 	//Panel

+ 2 - 2
src/ui/model/DecoratedNetwork.java

@@ -363,7 +363,7 @@ public class DecoratedNetwork {
 	}
 	
 	
-	public float getDiviationInProductionInNetworkForHolonObjects() {
+	public float getDeviationInProductionInNetworkForHolonObjects() {
 		return (float)Math.sqrt(getVarianzInProductionInNetworkForHolonObjects());
 	}
 	
@@ -376,7 +376,7 @@ public class DecoratedNetwork {
 		return sum / (float) getAmountOfHolonObjects();
 	}
 	
-	public float getDiviationInConsumptionInNetworkForHolonObjects() {
+	public float getDeviationInConsumptionInNetworkForHolonObjects() {
 		return (float)Math.sqrt(getVarianzInConsumptionInNetworkForHolonObjects());
 	}