|
@@ -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)) {
|