|
@@ -44,7 +44,7 @@ public class StorageProductionController {
|
|
|
for (StorageElement se: storages) {
|
|
|
if(!se.chargeDepleted()){
|
|
|
energyLeftToEnabled = energyLeftToEnabled - se.setStatusAndSetEnergy(
|
|
|
- StorageElement.Mode.EMIT, energyLeftToEnabled /*/ storagesLeft*/, energyRequiredForPowerplantBlackstart);
|
|
|
+ StorageElement.Mode.EMIT, energyLeftToEnabled / storagesLeft, energyRequiredForPowerplantBlackstart);
|
|
|
}
|
|
|
storagesLeft = storagesLeft - 1;
|
|
|
if(energyLeftToEnabled <= 0){
|
|
@@ -92,7 +92,9 @@ public class StorageProductionController {
|
|
|
double distancePenalty = 0;
|
|
|
for (StorageElement ele : storages) {
|
|
|
if(ele.getStatus().equals(StorageElement.Mode.EMIT)){
|
|
|
- distancePenalty = goodDistance(ele);
|
|
|
+ if(ele.getStatus().equals(StorageElement.Mode.EMIT)) {
|
|
|
+ distancePenalty += goodDistance(ele);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return distancePenalty;
|
|
@@ -107,7 +109,7 @@ public class StorageProductionController {
|
|
|
}
|
|
|
|
|
|
private double produceTooMuch(StorageElement ele){
|
|
|
- if(avgUtilization() <= ele.getUtilization()){
|
|
|
+ if(avgUtilization() >= ele.getUtilization(energyRequiredForPowerplantBlackstart)){
|
|
|
return 0;
|
|
|
}else{
|
|
|
return 1;
|
|
@@ -115,7 +117,7 @@ public class StorageProductionController {
|
|
|
}
|
|
|
|
|
|
private double produceTooLittle(StorageElement ele){
|
|
|
- if(avgUtilization() >= ele.getUtilization()){
|
|
|
+ if(avgUtilization() <= ele.getUtilization(energyRequiredForPowerplantBlackstart)){
|
|
|
return 0;
|
|
|
}else{
|
|
|
return 1;
|
|
@@ -136,7 +138,7 @@ public class StorageProductionController {
|
|
|
double totalUtilization = 0;
|
|
|
for (StorageElement ele : storages) {
|
|
|
if(ele.getStatus().equals(StorageElement.Mode.EMIT)){
|
|
|
- totalUtilization += ele.getUtilization();
|
|
|
+ totalUtilization += ele.getUtilization(energyRequiredForPowerplantBlackstart);
|
|
|
}
|
|
|
}
|
|
|
return totalUtilization/activeStorages();
|