|
@@ -12,6 +12,7 @@ import java.math.RoundingMode;
|
|
|
import java.text.NumberFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
+import java.util.DoubleSummaryStatistics;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.LinkedList;
|
|
@@ -999,14 +1000,28 @@ public abstract class TopologieAlgorithmFramework implements AddOn{
|
|
|
double switchCost = TopologieObjectiveFunction.calculateWildcardCost(state);
|
|
|
double totalCost = wildcardCost + cableCost + switchCost;
|
|
|
|
|
|
+ DoubleSummaryStatistics overStat = state.getNetworkList().stream().flatMap(net -> {
|
|
|
+ return net.getConsumerList().stream().filter(con -> con.getState() == HolonObjectState.OVER_SUPPLIED);
|
|
|
+ }).mapToDouble(con -> con.getSupplyBarPercentage()).summaryStatistics();
|
|
|
+
|
|
|
+ DoubleSummaryStatistics partiallyStat = state.getNetworkList().stream().flatMap(net -> {
|
|
|
+ return net.getConsumerList().stream().filter(con -> con.getState() == HolonObjectState.PARTIALLY_SUPPLIED);
|
|
|
+ }).mapToDouble(con -> con.getSupplyBarPercentage()).summaryStatistics();
|
|
|
+
|
|
|
return "HolonObjects["
|
|
|
+ " Passiv: " + percentage(amountOfPassiv, amountOfObjects)
|
|
|
+ " Producer: " + percentage(amountOfSupplier, amountOfObjects)
|
|
|
+ " Consumer: " + percentage(amountOfConsumer, amountOfObjects)
|
|
|
+ " Unsupplied: " + percentage(unSuppliedConsumer, amountOfConsumer)
|
|
|
- + " PartiallySupplied: " + percentage(partiallySuppliedConsumer, amountOfObjects)
|
|
|
+ + " PartiallySupplied: " + percentage(partiallySuppliedConsumer, amountOfObjects)
|
|
|
+ + " with SupplyPercentage(Min: " + partiallyStat.getMin()
|
|
|
+ + " Max: "+ partiallyStat.getMax()
|
|
|
+ + " Average: " +partiallyStat.getAverage() + ")"
|
|
|
+ " Supplied: " + percentage(suppliedConsumer, amountOfConsumer)
|
|
|
+ " Over: " + percentage(overSuppliedConsumer, amountOfConsumer)
|
|
|
+ + " with SupplyPercentage(Min: " + overStat.getMin()
|
|
|
+ + " Max: "+ overStat.getMax()
|
|
|
+ + " Average: " + overStat.getAverage() + ")"
|
|
|
+ "]" + " HolonElemnts["
|
|
|
+ " Active: " + percentage(activeElements, amountOfelements)
|
|
|
+ "]"
|