From fc88d371798ad30a0ca75fd40ab1b37ffee89c04 Mon Sep 17 00:00:00 2001 From: Ate Hempenius Date: Mon, 17 Mar 2025 15:08:19 +0100 Subject: [PATCH] cumulative topnode grid capacity of the energyModel agent should be only based on the electric nodes. --- _alp/Agents/EnergyModel/Code/Functions.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/_alp/Agents/EnergyModel/Code/Functions.java b/_alp/Agents/EnergyModel/Code/Functions.java index 47bd7097..8d01fd37 100644 --- a/_alp/Agents/EnergyModel/Code/Functions.java +++ b/_alp/Agents/EnergyModel/Code/Functions.java @@ -1447,7 +1447,7 @@ null, roundToDecimal( a.v_electricityImported_kWh-a.v_electricityExported_kWh, 2 double f_buildGridNodeTree() {/*ALCODESTART::1716884712799*/ //Initialize top level grid values -double topLevelGridCapacity_kW = 0; +double topLevelElectricGridCapacity_kW = 0; boolean topLevelGridCapacitiesKnown = true; // First make all links between GridNodes @@ -1462,9 +1462,11 @@ null, roundToDecimal( a.v_electricityImported_kWh-a.v_electricityExported_kWh, 2 if (parentNode == null) { f_gridNodeRecursiveAdd(GN); c_gridNodesTopLevel.add(GN); - topLevelGridCapacity_kW +=GN.p_capacity_kW; - if(!GN.p_realCapacityAvailable){ - topLevelGridCapacitiesKnown = false; + if(GN.p_energyCarrier == OL_EnergyCarriers.ELECTRICITY){ + topLevelElectricGridCapacity_kW +=GN.p_capacity_kW; + if(!GN.p_realCapacityAvailable){ + topLevelGridCapacitiesKnown = false; + } } } else { c_gridNodesNotTopLevel.add(GN); @@ -1478,9 +1480,9 @@ null, roundToDecimal( a.v_electricityImported_kWh-a.v_electricityExported_kWh, 2 Collections.reverse(c_gridNodeExecutionList); //Set cumulative toplevel grid values as energyModel values -v_liveConnectionMetaData.physicalCapacity_kW = topLevelGridCapacity_kW; -v_liveConnectionMetaData.contractedDeliveryCapacity_kW = topLevelGridCapacity_kW; -v_liveConnectionMetaData.contractedFeedinCapacity_kW = topLevelGridCapacity_kW; +v_liveConnectionMetaData.physicalCapacity_kW = topLevelElectricGridCapacity_kW; +v_liveConnectionMetaData.contractedDeliveryCapacity_kW = topLevelElectricGridCapacity_kW; +v_liveConnectionMetaData.contractedFeedinCapacity_kW = topLevelElectricGridCapacity_kW; v_liveConnectionMetaData.physicalCapacityKnown = topLevelGridCapacitiesKnown; v_liveConnectionMetaData.contractedDeliveryCapacityKnown = topLevelGridCapacitiesKnown; v_liveConnectionMetaData.contractedFeedinCapacityKnown = topLevelGridCapacitiesKnown;