From 0f31677c9af500106b87cc622d395032e65cba02 Mon Sep 17 00:00:00 2001
From: Ate Hempenius
Date: Thu, 16 Oct 2025 16:32:42 +0200
Subject: [PATCH 1/2] heating preferences class engine update
---
.../Zero_Interface/Levels/Level.level.xml | 25 ++++++++
_alp/Agents/Zero_Loader/Code/Functions.java | 59 +++++++++++--------
_alp/Agents/Zero_Loader/Code/Functions.xml | 10 +---
3 files changed, 63 insertions(+), 31 deletions(-)
diff --git a/_alp/Agents/Zero_Interface/Levels/Level.level.xml b/_alp/Agents/Zero_Interface/Levels/Level.level.xml
index 6fa99201..ab767277 100644
--- a/_alp/Agents/Zero_Interface/Levels/Level.level.xml
+++ b/_alp/Agents/Zero_Interface/Levels/Level.level.xml
@@ -8343,4 +8343,29 @@ else{
0
0
+
+ false
+ 1760623174363
+
+ 270
+ 480
+
+ true
+ true
+ false
+ SHAPE_DRAW_2D3D
+
+ false
+ -16777216
+ true
+ traceln(findFirst(energyModel.Houses, gc -> gc.p_heatingManagement != null).p_heatingManagement.getHeatingPreferences());
+
+
+
+ button
+
+
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java
index 63f06882..7e70e2f9 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.java
+++ b/_alp/Agents/Zero_Loader/Code/Functions.java
@@ -3445,7 +3445,7 @@ else if (GCH.p_bouwjaar < 2015) {
OL_GridConnectionHeatingType heatingType = avgc_data.p_avgHouseHeatingMethod;
f_addHeatAsset(house, heatingType, maxHeatOutputPower_kW);
f_addHeatManagement(house, heatingType, false);
-f_setHouseHeatingPreferences(house);
+house.p_heatingManagement.setHeatingPreferences(f_getHouseHeatingPreferences());
//Add hot water and cooking demand
f_addHotWaterDemand(house, house.p_floorSurfaceArea_m2);
@@ -3468,31 +3468,42 @@ else if (GCH.p_bouwjaar < 2015) {
/*ALCODEEND*/}
-double f_setHouseHeatingPreferences(GCHouse house)
+J_HeatingPreferences f_getHouseHeatingPreferences()
{/*ALCODESTART::1749728889988*/
-if (house.p_heatingManagement instanceof J_HeatingManagementSimple heatingManagement) {
- if( randomTrue(0.5) ){ //50% kans op ochtend ritme
- heatingManagement.nightTimeSetPoint_degC = uniform_discr(12,18);
- heatingManagement.dayTimeSetPoint_degC = uniform_discr(18, 24);
- heatingManagement.startOfDay_h = uniform_discr(5,10) + uniform_discr(0,4) / 4.0;
- heatingManagement.startOfNight_h = uniform_discr(21,23);
- // house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0,1),1);
- }
- else if (randomTrue(0.5) ){ // 25% kans op hele dag aan
- heatingManagement.nightTimeSetPoint_degC = uniform_discr(18,21);
- heatingManagement.dayTimeSetPoint_degC = heatingManagement.nightTimeSetPoint_degC;
- heatingManagement.startOfDay_h= -1;
- heatingManagement.startOfNight_h = 25;
- //house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0, 1),1);
- }
- else { // 25% kans op smiddags/savonds aan
- heatingManagement.nightTimeSetPoint_degC = uniform_discr(12,18);
- heatingManagement.dayTimeSetPoint_degC = uniform_discr(18, 24);
- heatingManagement.startOfDay_h = uniform_discr(14, 16) + uniform_discr(0,4) / 4.0;
- heatingManagement.startOfNight_h = uniform_discr(21,23);
- //house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0, 1),1);
- }
+double nightTimeSetPoint_degC = 18;
+double dayTimeSetPoint_degC = 20;
+double startOfDayTime_h = 8;
+double startOfNightTime_h = 23;
+
+if( randomTrue(0.5) ){ //50% kans op ochtend ritme
+ nightTimeSetPoint_degC = uniform_discr(12,18);
+ dayTimeSetPoint_degC = uniform_discr(18, 24);
+ startOfDayTime_h = uniform_discr(5,10) + uniform_discr(0,4) / 4.0;
+ startOfNightTime_h = uniform_discr(21,23);
+
+}
+else if (randomTrue(0.5) ){ // 25% kans op hele dag aan
+ nightTimeSetPoint_degC = uniform_discr(18,21);
+ dayTimeSetPoint_degC = nightTimeSetPoint_degC;
+ startOfDayTime_h = -1;
+ startOfNightTime_h = 25;
+
+}
+else { // 25% kans op smiddags/savonds aan
+ nightTimeSetPoint_degC = uniform_discr(12,18);
+ dayTimeSetPoint_degC = uniform_discr(18, 24);
+ startOfDayTime_h = uniform_discr(14, 16) + uniform_discr(0,4) / 4.0;
+ startOfNightTime_h = uniform_discr(21,23);
+
}
+
+double maxComfortTemperature_degC = dayTimeSetPoint_degC + 2;
+double minComfortTemperature_degC = dayTimeSetPoint_degC - 2;
+
+//Create heating preferences class
+J_HeatingPreferences heatingPreferences = new J_HeatingPreferences(startOfDayTime_h, startOfNightTime_h, dayTimeSetPoint_degC, nightTimeSetPoint_degC, maxComfortTemperature_degC, minComfortTemperature_degC);
+
+return heatingPreferences;
/*ALCODEEND*/}
double f_createParkingSpots()
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.xml b/_alp/Agents/Zero_Loader/Code/Functions.xml
index f5b67988..ea14c24c 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.xml
+++ b/_alp/Agents/Zero_Loader/Code/Functions.xml
@@ -1505,10 +1505,10 @@ verbruik = levering + productie - teruglevering]]>
- VOID
- double
+ RETURNS_VALUE
+ J_HeatingPreferences
1749728889988
-
+
460
700
From d8bb0835b061da8b06bdc0cb8565e250ffa5dc09 Mon Sep 17 00:00:00 2001
From: Ate Hempenius
Date: Fri, 17 Oct 2025 15:17:00 +0200
Subject: [PATCH 2/2] small parameter tweaks
---
.../Zero_Interface/Levels/Level.level.xml | 25 -------------------
_alp/Agents/Zero_Loader/Code/Functions.java | 23 ++++++++---------
2 files changed, 11 insertions(+), 37 deletions(-)
diff --git a/_alp/Agents/Zero_Interface/Levels/Level.level.xml b/_alp/Agents/Zero_Interface/Levels/Level.level.xml
index ab767277..6fa99201 100644
--- a/_alp/Agents/Zero_Interface/Levels/Level.level.xml
+++ b/_alp/Agents/Zero_Interface/Levels/Level.level.xml
@@ -8343,29 +8343,4 @@ else{
0
0
-
- false
- 1760623174363
-
- 270
- 480
-
- true
- true
- false
- SHAPE_DRAW_2D3D
-
- false
- -16777216
- true
- traceln(findFirst(energyModel.Houses, gc -> gc.p_heatingManagement != null).p_heatingManagement.getHeatingPreferences());
-
-
-
- button
-
-
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java
index 7e70e2f9..7a06022d 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.java
+++ b/_alp/Agents/Zero_Loader/Code/Functions.java
@@ -3208,7 +3208,7 @@ else if (surface_m2 > 50){
double initialTemp = uniform_discr(15,22); //starttemperatuur
double heatCapacity_JpK; //hoeveel lucht zit er in je huis dat je moet verwarmen?
double solarAbsorptionFactor_m2; //hoeveel m2 effectieve dak en muur oppervlakte er is dat opwarmt door zonneinstraling
-
+
switch (parentGC.p_energyLabel){
case A:
lossfactor_WpK = 0.35 * floorArea_m2;
@@ -3223,30 +3223,29 @@ else if (surface_m2 > 50){
lossfactor_WpK = 0.85 * floorArea_m2;
break;
case E:
- lossfactor_WpK = 0.105 * floorArea_m2;
+ lossfactor_WpK = 1.05 * floorArea_m2;
break;
case F:
- lossfactor_WpK = 0.125 * floorArea_m2;
+ lossfactor_WpK = 1.25 * floorArea_m2;
break;
case G:
- lossfactor_WpK = 0.145 * floorArea_m2;
+ lossfactor_WpK = 1.45 * floorArea_m2;
break;
case NONE:
- lossfactor_WpK = uniform (0.85, 1.2) * floorArea_m2;
- break;
default:
lossfactor_WpK = uniform (0.85, 1.2) * floorArea_m2;
}
lossfactor_WpK = roundToDecimal(lossfactor_WpK,2);
-solarAbsorptionFactor_m2 = floorArea_m2 * 0.1; //solar irradiance [W/m2]
+solarAbsorptionFactor_m2 = floorArea_m2 * 0.01; //solar irradiance [W/m2]
heatCapacity_JpK = floorArea_m2 * 50000;
-
-
+
parentGC.p_BuildingThermalAsset = new J_EABuilding( parentGC, maxPowerHeat_kW, lossfactor_WpK, energyModel.p_timeStep_h, initialTemp, heatCapacity_JpK, solarAbsorptionFactor_m2 );
energyModel.c_ambientDependentAssets.add( parentGC.p_BuildingThermalAsset );
-
+
+//FOR NOW DEFAULT NO INTERIOR/EXTERIOR HEAT BUFFERS -> NOT NECESSARY
+/*
double delayHeatReleaseInteriorHeatsink_hr = 0;
double lossToExteriorFromInteriorHeatSink_fr;
if(randomTrue(0.2)){
@@ -3260,7 +3259,7 @@ else if (surface_m2 > 50){
double delayHeatReleaseRoofAndWall_hr = 8.0;
parentGC.p_BuildingThermalAsset.addExteriorHeatBuffer(delayHeatReleaseRoofAndWall_hr);
-
+*/
/*ALCODEEND*/}
List f_getBuildingsInSubScope(List initialBuildingList)
@@ -3490,7 +3489,7 @@ else if (randomTrue(0.5) ){ // 25% kans op hele dag aan
}
else { // 25% kans op smiddags/savonds aan
- nightTimeSetPoint_degC = uniform_discr(12,18);
+ nightTimeSetPoint_degC = uniform_discr(14,18);
dayTimeSetPoint_degC = uniform_discr(18, 24);
startOfDayTime_h = uniform_discr(14, 16) + uniform_discr(0,4) / 4.0;
startOfNightTime_h = uniform_discr(21,23);