David Heck vor 5 Jahren
Ursprung
Commit
c0a748fd71

+ 10 - 10
src/blackstart/controlAlgorithm.java

@@ -229,7 +229,7 @@ public class controlAlgorithm implements AddOn {
 			/////////
 			disablePowerplantProduction();
 			enableAllConsumers();
-			SPC.disableStorageDischarging(-1); //disable all storage production
+			SPC.setAllStorageToStandy();
 			// TODO: prios?
 			/////////
 
@@ -273,7 +273,7 @@ public class controlAlgorithm implements AddOn {
 				blackstartRunningCounter++;
 				if (blackstartRunningCounter == blackstartSuccessTime) {
 					// blackstart was successfull for the needed iterations
-					SPC.disableStorageDischarging(-1);
+					SPC.setAllStorageToStandy();
 					deactivateBlackstart();
 					enableAllConsumers();
 					updateVisual();
@@ -299,13 +299,13 @@ public class controlAlgorithm implements AddOn {
 
 	/**
 	 * TODO: HOLEG UNTERVERSORGUNG CHECKEN
-	 * TODO: prios fuer elemente anschalten
-	 * TODO: elements und amount nachschauen + getEngergyPerElement anschauen
-	 * TODO: batterie status wechesel fuehrt zu unterversorgung in GUI FIX?: in storage if bei charge auskommentieren
-	 * TODO: batterie laden prios? entfernung? doppelt sortieren
 	 * TODO: renewables mit verlust
 	 * TODO: cable diameter/specificresistance
-	 * TODO: stelle fuer ergebnissausgabe ueberdenken
+	 *
+	 * maybes:
+	 * 	 * TODO: prios fuer elemente anschalten
+	 * 	 * TODO: batterie status wechesel fuehrt zu unterversorgung in GUI FIX?: in storage if bei charge auskommentieren
+	 * 	 * TODO: batterie laden prios? entfernung? doppelt sortieren
 	 *
 	 * @return true or false depending on whether the blackstart was successful for
 	 *         this iteration
@@ -316,14 +316,14 @@ public class controlAlgorithm implements AddOn {
 			// renewable energy production is not sufficient for the blackstart
 			if (SPC.currentPossibleStorageProduction() >= getEnergyRequiredForPowerplantBlackstart()
 					- currentRenewableProduction()) {// is there currently enough power available from storage?
-				SPC.disableStorageDischarging(-1);// emergency fix
+				SPC.setAllStorageToStandy();//TODO: placement
 				SPC.enableStorageDischarging(getEnergyRequiredForPowerplantBlackstart() - currentRenewableProduction());
 				rampUpPowerplant();
 				enableConsumers(getPowerplantProduction());
 				return true;
 			} else {
 				// blackstart has failed
-				SPC.disableStorageDischarging(-1);//TODO:disable all
+				SPC.setAllStorageToStandy();
 				println("Not enough storage energy available");
 				return false;
 			}
@@ -504,7 +504,7 @@ public class controlAlgorithm implements AddOn {
 		println("currenctpossiblestorage: " + SPC.currentPossibleStorageProduction());
 		for (StorageElement ele :
 				getStorageElements()) {
-			println("Storage " + ele.getId() + " charge: " + (ele.getStateOfCharge()/60)/1000 + "kWh"  + " at distance " + (ele.getLowDistance()+ele.getHighDistance()));
+			println("Storage " + ele.getId() + ", soc: " + (ele.getStateOfCharge()/60)/1000 + "kWh,"  + " maxpower: " + ele.getMaxOutRatio() + " W, distance: " + (ele.getLowDistance()+ele.getHighDistance()));
 		}
 	}
 

+ 4 - 0
src/classes/StorageElement.java

@@ -179,6 +179,10 @@ public class StorageElement extends HolonElement implements Comparable<StorageEl
 		return stateOfCharge;
 	}
 
+	public float getMaxOutRatio() {
+		return maxOutRatio;
+	}
+
 	public boolean chargeDepleted(){
 		return stateOfCharge <= 0;
 	}

+ 3 - 23
src/ui/controller/StorageProductionController.java

@@ -52,30 +52,10 @@ public class StorageProductionController {
             }
 	}
 
-	//TODO: redo algorithm to actually us it right...
-	public void disableStorageDischarging(float energyNotNeeded) {
-		if(energyNotNeeded == -1) {
-			for (StorageElement se : storages) {
-				se.setStatusAndSetEnergy(StorageElement.Mode.STANDBY, 0, energyRequiredForPowerplantBlackstart);
-			}
+	public void setAllStorageToStandy() {
+		for (StorageElement se : storages) {
+			se.setStatusAndSetEnergy(StorageElement.Mode.STANDBY, 0, energyRequiredForPowerplantBlackstart);
 		}
-//		float disabledEnergy = 0;
-//
-//		//TODO: disable furthest first?
-//		for (StorageElement se : storages) {
-//			if (se.getStatus().equals(StorageElement.Mode.EMIT)) {
-//				if(se.getEnergyPerElement() > energyNotNeeded){
-//					disabledEnergy = disabledEnergy + energyNotNeeded;
-//					se.setStatusAndSetEnergy(StorageElement.Mode.EMIT, se.getEnergyPerElement() - energyNotNeeded);
-//				}else{
-//					disabledEnergy = disabledEnergy + se.getEnergyPerElement();
-//					se.setStatusAndSetEnergy(StorageElement.Mode.STANDBY, 0);
-//				}
-//			}
-//			if (disabledEnergy >= energyNotNeeded) {
-//				return;
-//			}
-//		}
 	}
 
 	//TODO: selbe probleme wie discharging