|
@@ -167,11 +167,15 @@ public class StorageElement extends HolonElement implements Comparable<StorageEl
|
|
|
setCurrentMaxOutRatio();
|
|
|
}
|
|
|
|
|
|
+ public float getStateOfChargeInPercent(){// 1.0 = 100%
|
|
|
+ return stateOfCharge / capacity;
|
|
|
+ }
|
|
|
+
|
|
|
private void setCurrentMaxOutRatio(){
|
|
|
- if(stateOfCharge > capacity * 0.8){
|
|
|
- currentMaxOutRatio = (float) (nominalOutRatio * 1.1);
|
|
|
- }else if(stateOfCharge < capacity * 0.2){
|
|
|
- currentMaxOutRatio = (float) (nominalOutRatio * 0.8);
|
|
|
+ if(getStateOfChargeInPercent() > 0.8){
|
|
|
+ currentMaxOutRatio = (float) (nominalOutRatio * (1 + (0.005 * (getStateOfChargeInPercent() * 100 - 0.8 * 100))));
|
|
|
+ }else if(getStateOfChargeInPercent() < 0.2){
|
|
|
+ currentMaxOutRatio = (float) (nominalOutRatio * (1 - (0.01 * (0.2 * 100 - getStateOfChargeInPercent() * 100))));
|
|
|
}else{
|
|
|
currentMaxOutRatio = nominalOutRatio;
|
|
|
}
|
|
@@ -225,7 +229,7 @@ public class StorageElement extends HolonElement implements Comparable<StorageEl
|
|
|
}else if(this.stateOfCharge > storageElement.getStateOfCharge()){
|
|
|
return 1;
|
|
|
}else{
|
|
|
- return Double.compare(storageElement.getLowDistance()+storageElement.getHighDistance(), this.getLowDistance()+this.getHighDistance());
|
|
|
+ return Double.compare(storageElement.getLowDistance()+storageElement.getHighDistance(), this.getLowDistance() + this.getHighDistance());
|
|
|
}
|
|
|
}
|
|
|
|