Explorar el Código

fix consumption calculation now respects curve set in holeg

David Heck hace 4 años
padre
commit
0474797cb0

+ 3 - 2
src/blackstart/controlAlgorithm.java

@@ -346,7 +346,8 @@ public class controlAlgorithm implements AddOn {
 	/**
 	 * TODO: HOLEG UNTERVERSORGUNG CHECKEN
 	 * TODO: prios fuer elemente anschalten
-	 * TODO: elements und amount nachschauen
+	 * TODO: storage listen sotieren fuer moeglichst gleichemaessige lade / last verteilung
+	 * TODO: elements und amount nachschauen + getEngergyPerElement anschauen
 	 * TODO: batterie status wechesel fuehrt zu unterversorgung in GUI FIX?: in storage if bei charge auskommentieren
 	 * TODO: wie soll ich unter / ueberversorgung handeln vorm blackstart
 	 * TODO: batterie modes wo nicht passiert? obwohl laden / entladen moeglich waere?
@@ -490,7 +491,7 @@ public class controlAlgorithm implements AddOn {
 		for (HolonObject consumer : consumers) {
 			for (HolonElement ele : consumer.getElements()) {
 				if (energyAvailable > 0
-						&& energyAvailable - Math.abs(ele.getEnergyPerElement() * ele.getAmount()) >= 0) {
+						&& energyAvailable - Math.abs(ele.getEnergyPerElement() * ele.getAmount()) >= 0) {//TODO: getenergy ist hier falsch
 					if (!ele.isActive()) {
 						ele.setActive(true);
 						energyAvailable = energyAvailable - Math.abs(ele.getEnergyPerElement() * ele.getAmount());// +

+ 5 - 5
src/ui/controller/SimulationManager.java

@@ -105,9 +105,9 @@ public class SimulationManager {
                     float consumption = calculateConsumption(net);
                     float production = calculateProduction(net);
                     float difference = production - consumption;
-//                    System.out.println("Consumption " + consumption);
-//                    System.out.println("production " + production);
-//                    System.out.println("Difference " + difference);
+                    System.out.println("Consumption " + consumption);
+                    System.out.println("production " + production);
+                    System.out.println("Difference " + difference);
 
                     if(difference > 0){
                         SPC.enableStorageCharging(difference);
@@ -346,8 +346,8 @@ public class SimulationManager {
         for (HolonObject holonObject : net.getHolonObjectList()) {
             for(HolonElement holonElement : holonObject.getElements()){
                 if(holonElement.isActive()){
-                    if(holonElement.getEnergyPerElement() > 0){
-                        production = production + holonElement.getEnergyPerElement() * holonElement.getAmount();
+                    if(holonElement.getEnergyAtTimeStep(model.getCurIteration()) > 0){
+                        production = production + holonElement.getEnergyAtTimeStep(model.getCurIteration());
                     }
                 }
             }