|
@@ -105,9 +105,9 @@ public class SimulationManager {
|
|
float consumption = calculateConsumption(net);
|
|
float consumption = calculateConsumption(net);
|
|
float production = calculateProduction(net);
|
|
float production = calculateProduction(net);
|
|
float difference = production - consumption;
|
|
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){
|
|
if(difference > 0){
|
|
SPC.enableStorageCharging(difference);
|
|
SPC.enableStorageCharging(difference);
|
|
@@ -346,8 +346,8 @@ public class SimulationManager {
|
|
for (HolonObject holonObject : net.getHolonObjectList()) {
|
|
for (HolonObject holonObject : net.getHolonObjectList()) {
|
|
for(HolonElement holonElement : holonObject.getElements()){
|
|
for(HolonElement holonElement : holonObject.getElements()){
|
|
if(holonElement.isActive()){
|
|
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());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|