5 лет назад
Родитель
Сommit
8cad2e82ca
1 измененных файлов с 7 добавлено и 6 удалено
  1. 7 6
      src/exampleAlgorithms/Evaluation.java

+ 7 - 6
src/exampleAlgorithms/Evaluation.java

@@ -33,12 +33,13 @@ public class Evaluation {
 		
 		// calculate object_fitness
 		for(DecoratedNetwork net : state.getNetworkList()) {
-			object_fitness += net.getConsumerList().stream().map(con -> holonObjectSupplyPenaltyFunction(con.getSupplyBarPercentage()) 
-																		+ StateToDouble(con.getState()) 
-																		+ inactiveHolonElementPenalty(con.getModel()) ).reduce(0.0, Double::sum);
-			object_fitness += net.getPassivNoEnergyList().stream().map(sup -> inactiveHolonElementPenalty(sup.getModel())).reduce(0.0, Double::sum);
-			object_fitness += net.getSupplierList().stream().map(sup -> inactiveHolonElementPenalty(sup.getModel())).reduce(0.0, Double::sum);
-			object_fitness += net.getConsumerSelfSuppliedList().stream().map(con -> inactiveHolonElementPenalty(con.getModel())).reduce(0.0, Double::sum);
+
+			object_fitness += net.getConsumerList().stream().map(con -> holonObjectSupplyPenaltyFunction(con.getSupplyBarPercentage()) /*+ inactiveHolonElementPenalty(con.getModel())*/).reduce(0.0, (a, b) -> (a + b));
+			object_fitness += net.getConsumerList().stream().map(con -> StateToDouble(con.getState())).reduce(0.0, (a,b) -> (a+b));
+			//object_fitness += net.getPassivNoEnergyList().stream().map(sup -> inactiveHolonElementPenalty(sup.getModel())).reduce(0.0, (a, b) -> (a + b));
+			//object_fitness += net.getSupplierList().stream().map(sup -> inactiveHolonElementPenalty(sup.getModel())).reduce(0.0, (a, b) -> (a + b));
+			//object_fitness += net.getConsumerSelfSuppliedList().stream().map(con -> inactiveHolonElementPenalty(con.getModel())).reduce(0.0, (a, b) -> (a + b));
+
 		}
 		// calculate flexibility fitness old cost flex
 		/*for(FlexWrapper flexWrapper :state.getFlexManager().getAllFlexWrapperWithState(FlexState.IN_USE)) {