From d7ae3fd15f353ab4e5ef608f391c61036335f1cf Mon Sep 17 00:00:00 2001 From: Ate Hempenius Date: Wed, 17 Jun 2026 18:04:53 +0200 Subject: [PATCH 1/2] Districtheating_merit_order_and_losses --- Zero_engine.alpx | 4 + _alp/Agents/EnergyModel/Code/Functions.java | 12 +- _alp/Agents/EnergyModel/EmbeddedObjects.xml | 6 + _alp/Agents/GridNode/AOC.GridNode.xml | 12 +- _alp/Agents/GridNode/Code/Functions.java | 159 +++++------- _alp/Agents/GridNode/Code/Functions.xml | 184 +++++++------- _alp/Agents/GridNode/Levels/Level.level.xml | 67 +---- _alp/Agents/GridNode/Variables.xml | 229 ++++++++---------- _alp/Classes/Class.GISUtil.java | 11 + ...ss.J_HeatingManagementDistrictHeating.java | 28 ++- 10 files changed, 318 insertions(+), 394 deletions(-) create mode 100644 _alp/Classes/Class.GISUtil.java diff --git a/Zero_engine.alpx b/Zero_engine.alpx index 90810d25..9223e561 100644 --- a/Zero_engine.alpx +++ b/Zero_engine.alpx @@ -2229,6 +2229,10 @@ LARGE_CONNECTION (grootverbruik, > 3x80) 1776078970513 + + 1781710977201 + + com.anylogic.libraries.modules.markup_descriptors diff --git a/_alp/Agents/EnergyModel/Code/Functions.java b/_alp/Agents/EnergyModel/Code/Functions.java index 26946658..01163e64 100644 --- a/_alp/Agents/EnergyModel/Code/Functions.java +++ b/_alp/Agents/EnergyModel/Code/Functions.java @@ -159,14 +159,20 @@ v_batteryStoredEnergy_kWh = 0; if (b_parallelizeGridConnections) { - c_gridConnections.parallelStream().forEach(gc -> gc.f_calculateEnergyBalance(p_timeVariables, v_isRapidRun)); + c_gridConnections.parallelStream().forEach(gc -> {if(!(gc instanceof GCDistrictHeating)){ gc.f_calculateEnergyBalance(p_timeVariables, v_isRapidRun);}}); } else { for(GridConnection gc : c_gridConnections) { - gc.f_calculateEnergyBalance(p_timeVariables, v_isRapidRun); + if(!(gc instanceof GCDistrictHeating)){ + gc.f_calculateEnergyBalance(p_timeVariables, v_isRapidRun); + } } } +for(GCDistrictHeating GCDH : DistrictHeatingSystems){ + GCDH.f_calculateEnergyBalance(p_timeVariables, v_isRapidRun); +} + //OLD LOCATION OF AGGREGATOR CALL, NECESSARY IF MANAGEMENT IS WITHOUT TIME STEP DELAY for(GridConnection gc : c_gridConnections) { // Can't do this in parallel due to different threads writing to the same values! @@ -502,7 +508,7 @@ double f_gridNodeRecursiveAdd(GridNode GN) {/*ALCODESTART::1716886716306*/ c_gridNodeExecutionList.add(GN); -for (GridNode GNchild : GN.c_connectedGridNodes) { +for (GridNode GNchild : GN.f_getConnectedGridNodes()) { f_gridNodeRecursiveAdd(GNchild); } diff --git a/_alp/Agents/EnergyModel/EmbeddedObjects.xml b/_alp/Agents/EnergyModel/EmbeddedObjects.xml index 64b1ef39..ff9cddd6 100644 --- a/_alp/Agents/EnergyModel/EmbeddedObjects.xml +++ b/_alp/Agents/EnergyModel/EmbeddedObjects.xml @@ -90,6 +90,12 @@ + + + + + + true diff --git a/_alp/Agents/GridNode/AOC.GridNode.xml b/_alp/Agents/GridNode/AOC.GridNode.xml index 3ab0b8eb..fb7c606e 100644 --- a/_alp/Agents/GridNode/AOC.GridNode.xml +++ b/_alp/Agents/GridNode/AOC.GridNode.xml @@ -115,7 +115,7 @@ if (p_energyType.equals(OL_EnergyCarriers.HEAT)) { 1705919330576 50 - 850 + 880