|
@@ -61,6 +61,7 @@ import ui.model.DecoratedSwitch.SwitchState;
|
|
|
import ui.model.DecoratedNetwork;
|
|
|
import ui.view.Console;
|
|
|
import utility.ImageImport;
|
|
|
+import utility.StringFormat;
|
|
|
|
|
|
public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
//Algo
|
|
@@ -103,6 +104,7 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
//printing
|
|
|
private Printer runPrinter = new Printer(plottFileName());
|
|
|
protected List<Double> runList = new LinkedList<Double>();
|
|
|
+ private RunAverage avg = new RunAverage();
|
|
|
|
|
|
//Parameter
|
|
|
@SuppressWarnings("rawtypes")
|
|
@@ -525,7 +527,7 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
control.guiDisable(true);
|
|
|
runPrinter.openStream();
|
|
|
runPrinter.println("");
|
|
|
- runPrinter.println("Start:" + stringStatFromActualState());
|
|
|
+ runPrinter.println("Start:" + stringStatFromRunValues(getRunValuesFromActualState()));
|
|
|
runPrinter.closeStream();
|
|
|
if(this.useStepping) {
|
|
|
initParameterStepping();
|
|
@@ -595,13 +597,13 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
console.println("BitLength: " + access.size());
|
|
|
resetChain.removeLast();
|
|
|
runPrinter.openStream();
|
|
|
- runPrinter.println("");
|
|
|
runPrinter.println(algoInformationToPrint());
|
|
|
console.println(algoInformationToPrint());
|
|
|
runPrinter.closeStream();
|
|
|
runProgressbar.start();
|
|
|
Individual runBest = new Individual();
|
|
|
runBest.fitness = Double.MAX_VALUE;
|
|
|
+ this.avg = new RunAverage();
|
|
|
for(int r = 0; r < rounds; r++)
|
|
|
{
|
|
|
startTimer();
|
|
@@ -610,9 +612,12 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
long executionTime = printElapsedTime();
|
|
|
setState(roundBest.position);
|
|
|
runPrinter.openStream();
|
|
|
- runPrinter.println(runList.stream().map(Object::toString).collect(Collectors.joining(", ")));
|
|
|
- runPrinter.println(stringStatFromActualState());
|
|
|
- runPrinter.println("Result: " + roundBest.fitness + " ExecutionTime:" + executionTime);
|
|
|
+ runPrinter.println(runList.stream().map(value -> StringFormat.doubleFixedPlaces(2,value)).collect(Collectors.joining(", ")));
|
|
|
+ RunValues val = getRunValuesFromActualState();
|
|
|
+ val.result = roundBest.fitness;
|
|
|
+ val.executionTime = executionTime;
|
|
|
+ avg.addRun(val);
|
|
|
+ runPrinter.println("Result: " + StringFormat.doubleFixedPlaces(2,roundBest.fitness) + " ExecutionTime:" + executionTime + " " + stringStatFromRunValues(val));
|
|
|
runPrinter.closeStream();
|
|
|
resetState();
|
|
|
if(roundBest.fitness < runBest.fitness) runBest = roundBest;
|
|
@@ -622,9 +627,17 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
this.extractPositionAndAccess();
|
|
|
setState(runBest.position);
|
|
|
updateVisual();
|
|
|
- console.println("Start: " + startFitness);
|
|
|
- console.println("AlgoResult: " + runBest.fitness);
|
|
|
+ console.println("Start: " + StringFormat.doubleFixedPlaces(2,startFitness));
|
|
|
+ console.println("AlgoResult: " + StringFormat.doubleFixedPlaces(2,runBest.fitness));
|
|
|
if(this.algoUseFlexes)calculateAndPrintFlexInfos(control.getSimManager().getActualDecorState());
|
|
|
+ runPrinter.openStream();
|
|
|
+ if(rounds > 1) {
|
|
|
+ RunValues avgRun = avg.getAverage();
|
|
|
+
|
|
|
+ runPrinter.println("Average.Result: " + StringFormat.doubleFixedPlaces(2, avgRun.result) + " Average.ExecutionTime:" + avgRun.executionTime + " " + this.stringStatFromRunValues(avg.getAverage(), "Average."));
|
|
|
+ }
|
|
|
+ runPrinter.println("");
|
|
|
+ runPrinter.closeStream();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -817,65 +830,54 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- private String stringStatFromActualState() {
|
|
|
+ private RunValues getRunValuesFromActualState() {
|
|
|
+ RunValues val = new RunValues();
|
|
|
if(dGroupNode != null)
|
|
|
{
|
|
|
//GetActualDecoratedGroupNode
|
|
|
dGroupNode = control.getSimManager().getActualVisualRepresentationalState().getCreatedGroupNodes().get(dGroupNode.getModel());
|
|
|
- int amountOfSupplier = dGroupNode.getAmountOfSupplier();
|
|
|
- int amountOfConsumer = dGroupNode.getAmountOfConsumer();
|
|
|
- int amountOfPassiv = dGroupNode.getAmountOfPassiv();
|
|
|
- int amountOfObjects = amountOfSupplier + amountOfConsumer + amountOfPassiv;
|
|
|
- int unSuppliedConsumer = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.NOT_SUPPLIED);
|
|
|
- int partiallySuppliedConsumer = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.PARTIALLY_SUPPLIED);
|
|
|
- int suppliedConsumer = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.SUPPLIED);
|
|
|
- int overSuppliedConsumer = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.OVER_SUPPLIED);
|
|
|
+ val.producer = dGroupNode.getAmountOfSupplier();
|
|
|
+ val.consumer = dGroupNode.getAmountOfConsumer();
|
|
|
+ val.passiv = dGroupNode.getAmountOfPassiv();
|
|
|
+ val.objects = val.producer + val.consumer + val.passiv;
|
|
|
+ val.unsupplied = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.NOT_SUPPLIED);
|
|
|
+ val.partiallySupplied = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.PARTIALLY_SUPPLIED);
|
|
|
+ val.supplied = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.SUPPLIED);
|
|
|
+ val.overSupplied = dGroupNode.getAmountOfConsumerWithState(HolonObjectState.OVER_SUPPLIED);
|
|
|
|
|
|
|
|
|
- int activeElements = dGroupNode.getAmountOfAktiveElemntsFromHolonObjects();
|
|
|
- int elements = dGroupNode.getAmountOfElemntsFromHolonObjects();
|
|
|
- return "HolonObjects["
|
|
|
- + " Producer: " + amountOfSupplier + "/" + amountOfObjects + "("+ (float)amountOfSupplier/(float)amountOfObjects * 100 + "%)"
|
|
|
- + " Unsupplied: " + unSuppliedConsumer + "/" + amountOfObjects + "("+ (float)unSuppliedConsumer/(float)amountOfObjects * 100 + "%)"
|
|
|
- + " PartiallySupplied: " + partiallySuppliedConsumer + "/" + amountOfObjects + "("+ (float)partiallySuppliedConsumer/(float)amountOfObjects * 100 + "%)"
|
|
|
- + " Supplied: " + suppliedConsumer + "/" + amountOfObjects + "("+ (float)suppliedConsumer/(float)amountOfObjects * 100 + "%)"
|
|
|
- + " Passiv: " + overSuppliedConsumer + "/" + amountOfObjects + "("+ (float)overSuppliedConsumer/(float)amountOfObjects * 100 + "%)"
|
|
|
- + "]" + " HolonElemnts["
|
|
|
- + " Active: " + activeElements + "/" + elements + "("+ (float)activeElements/(float)elements * 100 + "%)"
|
|
|
- + "]";
|
|
|
+ val.activeElements = dGroupNode.getAmountOfAktiveElemntsFromHolonObjects();
|
|
|
+ val.elements = dGroupNode.getAmountOfElemntsFromHolonObjects();
|
|
|
+ //TODO what should be printed happen when only groupNode are selected
|
|
|
}
|
|
|
DecoratedState state = control.getSimManager().getActualDecorState();
|
|
|
- int amountOfSupplier = 0, amountOfConsumer = 0, amountOfPassiv = 0, unSuppliedConsumer = 0, partiallySuppliedConsumer = 0, suppliedConsumer = 0, overSuppliedConsumer = 0;
|
|
|
- int activeElements = 0, amountOfelements = 0;
|
|
|
- int totalConsumption = 0, totalProduction = 0;
|
|
|
for(DecoratedNetwork net : state.getNetworkList()) {
|
|
|
- amountOfConsumer += net.getAmountOfConsumer();
|
|
|
- amountOfSupplier += net.getAmountOfSupplier();
|
|
|
- amountOfPassiv += net.getAmountOfPassiv();
|
|
|
- unSuppliedConsumer += net.getAmountOfConsumerWithState(HolonObjectState.NOT_SUPPLIED);
|
|
|
- partiallySuppliedConsumer += net.getAmountOfConsumerWithState(HolonObjectState.PARTIALLY_SUPPLIED);
|
|
|
- suppliedConsumer += net.getAmountOfConsumerWithState(HolonObjectState.SUPPLIED);
|
|
|
- overSuppliedConsumer += net.getAmountOfConsumerWithState(HolonObjectState.OVER_SUPPLIED);
|
|
|
- amountOfelements += net.getAmountOfElements();
|
|
|
- activeElements += net.getAmountOfActiveElements();
|
|
|
- totalConsumption += net.getTotalConsumption();
|
|
|
- totalProduction += net.getTotalProduction();
|
|
|
+ val.consumer += net.getAmountOfConsumer();
|
|
|
+ val.producer += net.getAmountOfSupplier();
|
|
|
+ val.passiv += net.getAmountOfPassiv();
|
|
|
+ val.unsupplied += net.getAmountOfConsumerWithState(HolonObjectState.NOT_SUPPLIED);
|
|
|
+ val.partiallySupplied += net.getAmountOfConsumerWithState(HolonObjectState.PARTIALLY_SUPPLIED);
|
|
|
+ val.supplied += net.getAmountOfConsumerWithState(HolonObjectState.SUPPLIED);
|
|
|
+ val.overSupplied += net.getAmountOfConsumerWithState(HolonObjectState.OVER_SUPPLIED);
|
|
|
+ val.elements += net.getAmountOfElements();
|
|
|
+ val.activeElements += net.getAmountOfActiveElements();
|
|
|
+ val.consumption += net.getTotalConsumption();
|
|
|
+ val.production += net.getTotalProduction();
|
|
|
}
|
|
|
- int amountOfObjects = amountOfSupplier + amountOfConsumer + amountOfPassiv;
|
|
|
- int difference = Math.abs(totalProduction - totalConsumption);
|
|
|
+ val.objects = val.consumer + val.producer + val.passiv;
|
|
|
+ val.difference= Math.abs(val.production - val.consumption);
|
|
|
|
|
|
|
|
|
|
|
|
List<Flexibility> flexActiveList = control.getSimManager().getActualFlexManager().getAllFlexWrapperWithState(FlexState.IN_USE).stream().map(flex -> flex.getFlex()).collect(Collectors.toList());
|
|
|
- int amountActiveEssential = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Essential).count();
|
|
|
- int amountActiveHigh = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.High).count();
|
|
|
- int amountActiveMedium = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Medium).count();
|
|
|
- int amountActiveLow = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Low).count();
|
|
|
- int amountActiveFlexibilities = amountActiveEssential + amountActiveHigh + amountActiveMedium + amountActiveLow;
|
|
|
- int amountHolons = state.getNetworkList().size();
|
|
|
- int amountSwitch = state.getDecoratedSwitches().size();
|
|
|
- int amountActiveSwitch = (int)state.getDecoratedSwitches().stream().filter(dswitch -> (dswitch.getState() == SwitchState.Closed)).count();
|
|
|
+ val.essentialFlex = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Essential).count();
|
|
|
+ val.highFlex = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.High).count();
|
|
|
+ val.mediumFlex = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Medium).count();
|
|
|
+ val.lowFlex = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Low).count();
|
|
|
+ val.flexebilities = val.essentialFlex + val.highFlex + val.mediumFlex + val.lowFlex;
|
|
|
+ val.holon = state.getNetworkList().size();
|
|
|
+ val.switches = state.getDecoratedSwitches().size();
|
|
|
+ val.activeSwitches = (int)state.getDecoratedSwitches().stream().filter(dswitch -> (dswitch.getState() == SwitchState.Closed)).count();
|
|
|
|
|
|
DoubleSummaryStatistics overStat = state.getNetworkList().stream().flatMap(net -> {
|
|
|
return net.getConsumerList().stream().filter(con -> con.getState() == HolonObjectState.OVER_SUPPLIED);
|
|
@@ -885,39 +887,64 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
return net.getConsumerList().stream().filter(con -> con.getState() == HolonObjectState.PARTIALLY_SUPPLIED);
|
|
|
}).mapToDouble(con -> con.getSupplyBarPercentage()).summaryStatistics();
|
|
|
|
|
|
+ val.partiallyMin = filterInf(partiallyStat.getMin());
|
|
|
+ val.partiallyMax = filterInf(partiallyStat.getMax());
|
|
|
+ val.partiallyAverage = filterInf(partiallyStat.getAverage());
|
|
|
+
|
|
|
+ val.overMin = filterInf(overStat.getMin());
|
|
|
+ val.overMax = filterInf(overStat.getMax());
|
|
|
+ val.overAverage = filterInf(overStat.getAverage());
|
|
|
+
|
|
|
+ return val;
|
|
|
|
|
|
- return "HolonObjects["
|
|
|
- + " Passiv: " + percentage(amountOfPassiv, amountOfObjects)
|
|
|
- + " Producer: " + percentage(amountOfSupplier, amountOfObjects)
|
|
|
- + " Consumer: " + percentage(amountOfConsumer, amountOfObjects)
|
|
|
- + " Unsupplied: " + percentage(unSuppliedConsumer, amountOfConsumer)
|
|
|
- + " PartiallySupplied: " + percentage(partiallySuppliedConsumer, amountOfConsumer)
|
|
|
- + " 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)
|
|
|
- + "]" + "Flexibilities_active["
|
|
|
- + " Essential: " + percentage(amountActiveEssential, amountActiveFlexibilities)
|
|
|
- + " High: " + percentage(amountActiveHigh, amountActiveFlexibilities)
|
|
|
- + " Medium: " + percentage(amountActiveMedium, amountActiveFlexibilities)
|
|
|
- + " Low: " + percentage(amountActiveLow, amountActiveFlexibilities)
|
|
|
- + "]" + " activeSwitches:" + percentage(amountActiveSwitch,amountSwitch)
|
|
|
- + " Holons: " + amountHolons
|
|
|
- + " totalConsumption: " + totalConsumption
|
|
|
- + " totalProduction: " + totalProduction
|
|
|
- + " difference: " + difference;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private double filterInf(double value) {
|
|
|
+ if(value == Double.NEGATIVE_INFINITY || value == Double.POSITIVE_INFINITY || value == Double.NaN) {
|
|
|
+ return 0;
|
|
|
+ }else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String stringStatFromRunValues(RunValues val){
|
|
|
+ return stringStatFromRunValues(val , "");
|
|
|
+ }
|
|
|
+
|
|
|
+ private String stringStatFromRunValues(RunValues val, String prefix) {
|
|
|
+ return prefix +"Passiv: " + percentage(val.passiv, val.objects)
|
|
|
+ + " " + prefix +"Producer: " + percentage(val.producer, val.objects)
|
|
|
+ + " " + prefix +"Consumer: " + percentage(val.consumer, val.objects)
|
|
|
+ + " " + prefix +"Unsupplied: " + percentage(val.unsupplied, val.objects)
|
|
|
+ + " " + prefix +"Partially: " + percentage(val.partiallySupplied, val.objects)
|
|
|
+ + " " + prefix +"Over: " + percentage(val.overSupplied, val.objects)
|
|
|
+ + " " + prefix +"Supplied: " + percentage(val.supplied, val.objects)
|
|
|
+ + " " + prefix +"Partially.SupplyPercentage.Min: " + StringFormat.doubleFixedPlaces(2, val.partiallyMin)
|
|
|
+ + " " + prefix +"Partially.SupplyPercentage.Max: "+ StringFormat.doubleFixedPlaces(2, val.partiallyMax)
|
|
|
+ + " " + prefix +"Partially.SupplyPercentage.Average: " + StringFormat.doubleFixedPlaces(2, val.partiallyAverage)
|
|
|
+ + " " + prefix +"Over.SupplyPercentage.Min: " + StringFormat.doubleFixedPlaces(2, val.overMin)
|
|
|
+ + " " + prefix +"Over.SupplyPercentage.Max: "+ StringFormat.doubleFixedPlaces(2, val.overMax)
|
|
|
+ + " " + prefix +"Over.SupplyPercentage.Average: " + StringFormat.doubleFixedPlaces(2, val.overAverage)
|
|
|
+ + " " + prefix +"HolonElemnts.Active:" + percentage(val.activeElements, val.elements)
|
|
|
+ + " " + prefix +"Flexibilities.Essential: " + percentage(val.essentialFlex, val.flexebilities)
|
|
|
+ + " " + prefix +"Flexibilities.High: " + percentage(val.highFlex, val.flexebilities)
|
|
|
+ + " " + prefix +"Flexibilities.Medium: " + percentage(val.mediumFlex, val.flexebilities)
|
|
|
+ + " " + prefix +"Flexibilities.Low: " + percentage(val.lowFlex, val.flexebilities)
|
|
|
+ + " " + prefix +"Switches.Active:" + percentage(val.activeSwitches,val.switches)
|
|
|
+ + " " + prefix +"Holons: " + val.holon
|
|
|
+ + " " + prefix +"TotalConsumption: " + val.consumption
|
|
|
+ + " " + prefix +"TotalProduction: " + val.production
|
|
|
+ + " " + prefix +"Difference: " + val.difference;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- private String percentage(int actual, int max) {
|
|
|
- return actual + "/" + max + "("+ (float)actual/(float)max * 100 + "%)";
|
|
|
+ private String percentage(double numerator , double denominator) {
|
|
|
+ if((int)denominator == 0) {
|
|
|
+ return "-%";
|
|
|
+ }
|
|
|
+ return StringFormat.doubleTwoPlaces(numerator) + "/" + StringFormat.doubleTwoPlaces(denominator) + " "+ StringFormat.doubleFixedPlaces(2,(float)numerator /(float)denominator * 100) + "%";
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1006,6 +1033,124 @@ public abstract class AlgorithmFrameworkFlex implements AddOn{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private class RunValues{
|
|
|
+ public double result;
|
|
|
+ public double executionTime;
|
|
|
+
|
|
|
+ public double objects;
|
|
|
+ public double passiv;
|
|
|
+ public double consumer;
|
|
|
+ public double supplied;
|
|
|
+ public double producer;
|
|
|
+ public double unsupplied;
|
|
|
+ public double partiallySupplied;
|
|
|
+ public double overSupplied;
|
|
|
+
|
|
|
+ public double partiallyMin;
|
|
|
+ public double partiallyMax;
|
|
|
+ public double partiallyAverage;
|
|
|
+ public double overMin;
|
|
|
+ public double overMax;
|
|
|
+ public double overAverage;
|
|
|
+
|
|
|
+ public double activeElements;
|
|
|
+ public double elements;
|
|
|
+
|
|
|
+ public double essentialFlex;
|
|
|
+ public double highFlex;
|
|
|
+ public double mediumFlex;
|
|
|
+ public double lowFlex;
|
|
|
+ public double flexebilities;
|
|
|
+
|
|
|
+ public double switches;
|
|
|
+ public double activeSwitches;
|
|
|
+
|
|
|
+ public double holon;
|
|
|
+ public double consumption;
|
|
|
+ public double production;
|
|
|
+ public double difference;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private class RunAverage{
|
|
|
+ private int runCount = 0;
|
|
|
+ //Values
|
|
|
+ private RunValues sum = new RunValues();
|
|
|
+
|
|
|
+ public void addRun(RunValues val) {
|
|
|
+ sum.result += val.result;
|
|
|
+ sum.executionTime += val.executionTime;
|
|
|
+ sum.passiv += val.passiv;
|
|
|
+ sum.consumer += val.consumer;
|
|
|
+ sum.producer += val.producer;
|
|
|
+ sum.unsupplied += val.unsupplied;
|
|
|
+ sum.partiallySupplied += val.partiallySupplied;
|
|
|
+ sum.overSupplied += val.overSupplied;
|
|
|
+ sum.activeElements += val.activeElements;
|
|
|
+ sum.elements += val.elements;
|
|
|
+ sum.essentialFlex += val.essentialFlex;
|
|
|
+ sum.highFlex += val.highFlex;
|
|
|
+ sum.mediumFlex += val.mediumFlex;
|
|
|
+ sum.lowFlex += val.lowFlex;
|
|
|
+ sum.flexebilities += val.flexebilities;
|
|
|
+ sum.holon += val.holon;
|
|
|
+ sum.switches += val.switches;
|
|
|
+ sum.activeSwitches += val.activeSwitches;
|
|
|
+ sum.consumption += val.consumption;
|
|
|
+ sum.production += val.production;
|
|
|
+ sum.difference += val.difference;
|
|
|
+ sum.objects += val.objects;
|
|
|
+ sum.supplied += val.supplied;
|
|
|
+ sum.partiallyMin += val.partiallyMin;
|
|
|
+ sum.partiallyMax += val.partiallyMax;
|
|
|
+ sum.partiallyAverage += val.partiallyAverage;
|
|
|
+ sum.overMin += val.overMin;
|
|
|
+ sum.overMax += val.overMax;
|
|
|
+ sum.overAverage += val.overAverage;
|
|
|
+
|
|
|
+ runCount++;
|
|
|
+ }
|
|
|
+ public RunValues getAverage() {
|
|
|
+ RunValues avg = new RunValues();
|
|
|
+ if(runCount == 0) {
|
|
|
+ return avg;
|
|
|
+ }
|
|
|
+ avg.result = sum.result / runCount;
|
|
|
+ avg.executionTime = sum.executionTime / runCount;
|
|
|
+ avg.passiv = sum.passiv / runCount;
|
|
|
+ avg.consumer = sum.consumer / runCount;
|
|
|
+ avg.producer = sum.producer / runCount;
|
|
|
+ avg.unsupplied = sum.unsupplied / runCount;
|
|
|
+ avg.partiallySupplied = sum.partiallySupplied / runCount;
|
|
|
+ avg.overSupplied = sum.overSupplied / runCount;
|
|
|
+ avg.activeElements = sum.activeElements / runCount;
|
|
|
+ avg.elements = sum.elements / runCount;
|
|
|
+ avg.essentialFlex = sum.essentialFlex / runCount;
|
|
|
+ avg.highFlex = sum.highFlex / runCount;
|
|
|
+ avg.mediumFlex = sum.mediumFlex / runCount;
|
|
|
+ avg.lowFlex = sum.lowFlex / runCount;
|
|
|
+ avg.flexebilities = sum.flexebilities / runCount;
|
|
|
+ avg.holon = sum.holon / runCount;
|
|
|
+ avg.switches = sum.switches / runCount;
|
|
|
+ avg.activeSwitches = sum.activeSwitches / runCount;
|
|
|
+ avg.consumption = sum.consumption / runCount;
|
|
|
+ avg.production = sum.production / runCount;
|
|
|
+ avg.difference = sum.difference / runCount;
|
|
|
+ avg.objects = sum.objects / runCount;
|
|
|
+ avg.supplied = sum.supplied / runCount;
|
|
|
+ avg.supplied = sum.supplied / runCount;
|
|
|
+ avg.partiallyMin = sum.partiallyMin / runCount;
|
|
|
+ avg.partiallyMax = sum.partiallyMax / runCount;
|
|
|
+ avg.partiallyAverage = sum.partiallyAverage / runCount;
|
|
|
+ avg.overMin = sum.overMin / runCount;
|
|
|
+ avg.overMax = sum.overMax / runCount;
|
|
|
+ avg.overAverage = sum.overAverage / runCount;
|
|
|
+ return avg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private enum AccessType {None, HolonElement, Switch, Flexibility, KillSwitch};
|
|
|
/**
|
|
|
* A Wrapper Class for Access HolonElement and HolonSwitch in one Element and not have to split the List.
|