From 3fc5e4e0925387bbf06e49fb11a593befd643ab3 Mon Sep 17 00:00:00 2001
From: Bas
Date: Fri, 13 Mar 2026 18:21:07 +0100
Subject: [PATCH 1/3] Added orientation + angle optionality for PV systems
Add roof_orientation and roof_pitch_deg to Building_data
Added orientation and tilt_angle_deg to Solarfarm_data
Splitted f_addEnergyProduction into three functions f_addWindProductionAsset, f_addPVProductionAsset and f_addPTProductionAsset.
Added f_determinePVTProfilePointer to search for correct ProfilePointer
---
Zero_Interface-Loader.alpx | 2 +-
_alp/Agents/Zero_Loader/Code/Functions.java | 86 ++++++++++--
_alp/Agents/Zero_Loader/Code/Functions.xml | 143 +++++++++++++++++++-
_alp/Classes/Class.Building_data.java | 2 +
_alp/Classes/Class.Solarfarm_data.java | 2 +
5 files changed, 220 insertions(+), 15 deletions(-)
diff --git a/Zero_Interface-Loader.alpx b/Zero_Interface-Loader.alpx
index 5656f66f..43752d46 100644
--- a/Zero_Interface-Loader.alpx
+++ b/Zero_Interface-Loader.alpx
@@ -1,7 +1,7 @@
1658477103134
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java
index 013d7655..de2e4eca 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.java
+++ b/_alp/Agents/Zero_Loader/Code/Functions.java
@@ -304,7 +304,8 @@ else if(RegionCoords.startsWith("LineString")){
}
}
if(gridNodeProfileLoaderType != OL_GridNodeProfileLoaderType.INCLUDE_PV || gridNodeProfileLoaderType != OL_GridNodeProfileLoaderType.NET_LOAD){
- f_addEnergyProduction(solarpark, OL_EnergyAssetType.PHOTOVOLTAIC, "Solar farm" , dataSolarfarm.capacity_electric_kw());
+ f_addPVProductionAsset(solarpark, "Solar farm" , dataSolarfarm.capacity_electric_kw(), dataSolarfarm.orientation(), dataSolarfarm.tilt_angle_deg());
+ //f_addEnergyProduction(solarpark, OL_EnergyAssetType.PHOTOVOLTAIC, "Solar farm" , dataSolarfarm.capacity_electric_kw());
}
//Set owner
@@ -611,7 +612,8 @@ else if(RegionCoords.startsWith("LineString")){
windfarm.v_isActive = dataWindfarm.initially_active();
//Create EA for the windturbine GC
- f_addEnergyProduction(windfarm, OL_EnergyAssetType.WINDMILL, "Windmill onshore", dataWindfarm.capacity_electric_kw());
+ f_addWindProductionAsset(windfarm, "Windmill onshore", dataWindfarm.capacity_electric_kw());
+ //f_addEnergyProduction(windfarm, OL_EnergyAssetType.WINDMILL, "Windmill onshore", dataWindfarm.capacity_electric_kw());
//Set owner
ConnectionOwner owner;
@@ -1018,7 +1020,7 @@ GIS_Building f_createGISBuilding(Building_data buildingData,GridConnection paren
double f_addEnergyProduction(GridConnection parentGC,OL_EnergyAssetType asset_type,String asset_name,double installedPower_kW)
{/*ALCODESTART::1726584205809*/
-double assetCapacity_kW = 0;
+double assetCapacity_kW = 0;
J_TimeParameters timeParameters = energyModel.p_timeParameters;
J_ProfilePointer profilePointer = null;
OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.ELECTRICITY;
@@ -1529,7 +1531,8 @@ else if (vehicle_type == OL_EnergyAssetType.PETROLEUM_FUEL_VAN){
pv_installed_kwp = 0.0;
}
if(pv_installed_kwp != null && pv_installed_kwp > 0){
- f_addEnergyProduction(companyGC, OL_EnergyAssetType.PHOTOVOLTAIC, "Rooftop Solar", pv_installed_kwp);
+ f_addPVProductionAsset(companyGC, "Rooftop Solar", pv_installed_kwp, OL_Orientation.SOUTH, 35.0);
+ //f_addEnergyProduction(companyGC, OL_EnergyAssetType.PHOTOVOLTAIC, "Rooftop Solar", pv_installed_kwp);
current_scenario_list.setCurrentPV_kW(roundToInt(pv_installed_kwp));
future_scenario_list.setPlannedPV_kW(roundToInt(pv_installed_kwp));
@@ -2367,7 +2370,8 @@ else if(!settings.createCurrentElectricityEA()){//input boolean: Dont create cur
current_scenario_list.setCurrentPV_kW(gridConnection.getSupply().getPvInstalledKwp());
} else if (gridConnection.getSupply().getPvInstalledKwp() != null && gridConnection.getSupply().getPvInstalledKwp() > 0){
//gridConnection.getSupply().getPvOrientation(); // Wat doen we hier mee????? Nog niets!
- f_addEnergyProduction(companyGC, OL_EnergyAssetType.PHOTOVOLTAIC, "Rooftop Solar", gridConnection.getSupply().getPvInstalledKwp());
+ f_addPVProductionAsset(companyGC, "Rooftop Solar", (double) gridConnection.getSupply().getPvInstalledKwp(), OL_Orientation.SOUTH, 35.0); //NEEDS FIXING
+ //f_addEnergyProduction(companyGC, OL_EnergyAssetType.PHOTOVOLTAIC, "Rooftop Solar", gridConnection.getSupply().getPvInstalledKwp());
//add to scenario: current
current_scenario_list.setCurrentPV_kW(gridConnection.getSupply().getPvInstalledKwp());
@@ -2375,7 +2379,8 @@ else if(!settings.createCurrentElectricityEA()){//input boolean: Dont create cur
}
//Wind
if (gridConnection.getSupply().getWindInstalledKw() != null && gridConnection.getSupply().getWindInstalledKw() > 0){
- f_addEnergyProduction(companyGC, OL_EnergyAssetType.WINDMILL, "Wind mill", gridConnection.getSupply().getWindInstalledKw());
+ f_addWindProductionAsset(companyGC, "Wind mill", gridConnection.getSupply().getWindInstalledKw());
+ //f_addEnergyProduction(companyGC, OL_EnergyAssetType.WINDMILL, "Wind mill", gridConnection.getSupply().getWindInstalledKw());
//add to scenario: current
current_scenario_list.setCurrentWind_kW(gridConnection.getSupply().getWindInstalledKw());
@@ -3256,7 +3261,8 @@ else if (maxFeedin_kWh > 0 && !isPvPowerKnownAndPositive){
pvPower_kW = 2.5 * (maxFeedin_kWh/energyModel.p_timeParameters.getTimeStep_h()); // Estimation needed for pv power
traceln("PV Power has been estimated!");
f_createPreprocessedElectricityProfile_PV(GC_GridNode_profile, a_yearlyElectricityDelivery_kWh, a_yearlyElectricityFeedin_kWh, null, pvPower_kW, null);
- f_addEnergyProduction(GC_GridNode_profile, OL_EnergyAssetType.PHOTOVOLTAIC, "Total current Solar on GridNode", pvPower_kW);
+ f_addPVProductionAsset(GC_GridNode_profile, "Total current Solar on GridNode", pvPower_kW, OL_Orientation.SOUTH, 35.0);
+ //f_addEnergyProduction(GC_GridNode_profile, OL_EnergyAssetType.PHOTOVOLTAIC, "Total current Solar on GridNode", pvPower_kW);
}
else { //EXCLUDE_PV
throw new RuntimeException("Grid node profile contains feed-in but no PV power is found in Building_data for EXCLUDE_PV. This is not allowed.");
@@ -3268,7 +3274,8 @@ else if (maxFeedin_kWh > 0 && !isPvPowerKnownAndPositive){
}
f_createPreprocessedElectricityProfile_PV(GC_GridNode_profile, a_yearlyElectricityDelivery_kWh, a_yearlyElectricityFeedin_kWh, null, pvPower_kW, null);
if (gridnode.p_profileType == OL_GridNodeProfileLoaderType.INCLUDE_PV){
- f_addEnergyProduction(GC_GridNode_profile, OL_EnergyAssetType.PHOTOVOLTAIC, "Total current Solar on GridNode", pvPower_kW);
+ f_addPVProductionAsset(GC_GridNode_profile, "Total current Solar on GridNode", pvPower_kW, OL_Orientation.SOUTH, 35.0);
+ //f_addEnergyProduction(GC_GridNode_profile, OL_EnergyAssetType.PHOTOVOLTAIC, "Total current Solar on GridNode", pvPower_kW);
}
}
}
@@ -3569,7 +3576,7 @@ else if (houseBuildingData.insulation_label() != null) {
GCH.v_liveAssetsMetaData.PVPotential_kW = GCH.v_liveAssetsMetaData.initialPV_kW > 0 ? GCH.v_liveAssetsMetaData.initialPV_kW : houseBuildingData.pv_potential_kwp(); // To prevent sliders from changing outcomes
//Create and add EnergyAssets
- f_addEnergyAssetsToHouses(GCH, houseBuildingData.electricity_consumption_kwhpa(), houseBuildingData.gas_consumption_m3pa(), houseBuildingData.heating_type(), houseBuildingData.cooking_type());
+ f_addEnergyAssetsToHouses(GCH, houseBuildingData.electricity_consumption_kwhpa(), houseBuildingData.gas_consumption_m3pa(), houseBuildingData.heating_type(), houseBuildingData.cooking_type(), houseBuildingData.roof_orientation(), houseBuildingData.roof_pitch_deg());
i++;
}
@@ -3584,7 +3591,7 @@ else if (houseBuildingData.insulation_label() != null) {
//traceln("Total space heat demand houses input " + roundToDecimal(totalSpaceHeatDemand_kwhpa/1000000,3) + "GWh");
/*ALCODEEND*/}
-double f_addEnergyAssetsToHouses(GCHouse house,Double electricityDemand_kwhpa,Double gasDemand_m3pa,OL_GridConnectionHeatingType heatingType,OL_HouseholdCookingMethod cookingType)
+double f_addEnergyAssetsToHouses(GCHouse house,Double electricityDemand_kwhpa,Double gasDemand_m3pa,OL_GridConnectionHeatingType heatingType,OL_HouseholdCookingMethod cookingType,OL_Orientation orientation,double roofPitch_deg)
{/*ALCODESTART::1749728889986*/
//Add generic electricity demand profile
GridNode gn = findFirst(energyModel.pop_gridNodes, x -> x.p_gridNodeID.equals( house.p_parentNodeElectricID));
@@ -3603,7 +3610,7 @@ else if (houseBuildingData.insulation_label() != null) {
//Add pv
-f_addPVToHouses(house, gn);
+f_addPVToHouses(house, gn, orientation, roofPitch_deg);
//Add cars
f_addCarsToHouses(house);
@@ -5216,7 +5223,7 @@ Double f_getGNTotalPV_kWp(GridNode GN)
return totalPVPower_kW;
/*ALCODEEND*/}
-double f_addPVToHouses(GCHouse house,GridNode gn)
+double f_addPVToHouses(GCHouse house,GridNode gn,OL_Orientation orientation,double roofPitch_deg)
{/*ALCODESTART::1770037586816*/
double installedRooftopSolar_kW = house.v_liveAssetsMetaData.initialPV_kW != null ? house.v_liveAssetsMetaData.initialPV_kW : 0;
@@ -5225,7 +5232,60 @@ Double f_getGNTotalPV_kWp(GridNode GN)
}
if (installedRooftopSolar_kW > 0) {
- f_addEnergyProduction(house, OL_EnergyAssetType.PHOTOVOLTAIC, "Residential Solar", installedRooftopSolar_kW );
+ f_addPVProductionAsset(house, "Residential Solar", installedRooftopSolar_kW, orientation, roofPitch_deg);
+ //f_addEnergyProduction(house, OL_EnergyAssetType.PHOTOVOLTAIC, "Residential Solar", installedRooftopSolar_kW);
}
/*ALCODEEND*/}
+double f_addPVProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW,OL_Orientation orientation,double roofPitch_deg)
+{/*ALCODESTART::1773414911038*/
+J_TimeParameters timeParameters = energyModel.p_timeParameters;
+OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.ELECTRICITY;
+J_ProfilePointer profilePointer = f_determinePVTProfilePointer(orientation, roofPitch_deg);
+
+J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.PHOTOVOLTAIC, asset_name, energyCarrier, installedPower_kW, timeParameters, profilePointer);
+/*ALCODEEND*/}
+
+J_ProfilePointer f_determinePVTProfilePointer(OL_Orientation orientation,double roofPitch_deg)
+{/*ALCODESTART::1773414911040*/
+J_ProfilePointer profilePointer = null;
+
+switch (orientation){
+ case EASTWEST:
+ if (roofPitch_deg <= 15 && roofPitch_deg >= 0){
+ profilePointer = energyModel.pp_PVProduction15DegEastWest_fr;
+ }
+ else {
+ throw new RuntimeException("ProfilePointer for a combination of " + orientation + " and " + roofPitch_deg + " is not supported (yet)!");
+ }
+ case SOUTH:
+ if (roofPitch_deg <= 35 && roofPitch_deg >= 0){
+ profilePointer = energyModel.pp_PVProduction35DegSouth_fr;
+ }
+ else {
+ throw new RuntimeException("ProfilePointer for a combination of " + orientation + " and " + roofPitch_deg + " is not supported (yet)!");
+ }
+}
+
+return profilePointer;
+/*ALCODEEND*/}
+
+double f_addWindProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW)
+{/*ALCODESTART::1773414911042*/
+J_TimeParameters timeParameters = energyModel.p_timeParameters;
+OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.ELECTRICITY;
+J_ProfilePointer profilePointer = energyModel.pp_windProduction_fr;
+
+J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.WINDMILL, asset_name, energyCarrier, installedPower_kW, timeParameters, profilePointer);
+/*ALCODEEND*/}
+
+double f_addPTProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW,OL_Orientation orientation,int roofPitch_deg)
+{/*ALCODESTART::1773414911044*/
+//CONCEPT VERSION
+J_TimeParameters timeParameters = energyModel.p_timeParameters;
+OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.HEAT;
+J_ProfilePointer profilePointer = f_determinePVTProfilePointer(orientation, roofPitch_deg);
+
+J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.PHOTOVOLTAIC, asset_name, energyCarrier, installedPower_kW, timeParameters, profilePointer);
+/*ALCODEEND*/}
+
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.xml b/_alp/Agents/Zero_Loader/Code/Functions.xml
index 4817ad8c..536343ab 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.xml
+++ b/_alp/Agents/Zero_Loader/Code/Functions.xml
@@ -320,6 +320,7 @@
double
1726584205809
+ true
1320
190
@@ -2744,7 +2753,7 @@ verbruik = levering + productie - teruglevering]]>
-
+
VOID
double
1768486498278
@@ -2855,6 +2864,138 @@ verbruik = levering + productie - teruglevering]]>
+
+
+
+
+
+
+
+
+
+
+
+ VOID
+ double
+ 1773414911038
+
+ 1510
+ 180
+
+ false
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RETURNS_VALUE
+ J_ProfilePointer
+ 1773414911040
+
+ 1530
+ 220
+
+ false
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+ VOID
+ double
+ 1773414911042
+
+ 1510
+ 160
+
+ false
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ VOID
+ double
+ 1773414911044
+
+ 1510
+ 200
+
+ false
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_alp/Classes/Class.Building_data.java b/_alp/Classes/Class.Building_data.java
index 6ba26953..bfb31d61 100644
--- a/_alp/Classes/Class.Building_data.java
+++ b/_alp/Classes/Class.Building_data.java
@@ -27,6 +27,8 @@ public class Building_data {
Double gas_consumption_m3pa;
Double pv_installed_kwp;
Double pv_potential_kwp;
+ OL_Orientation roof_orientation;
+ double roof_pitch_deg;
OL_GridConnectionEnergyLabel energy_label;
Boolean has_private_parking;
String gridnode_id;
diff --git a/_alp/Classes/Class.Solarfarm_data.java b/_alp/Classes/Class.Solarfarm_data.java
index f436d1cb..bce5a717 100644
--- a/_alp/Classes/Class.Solarfarm_data.java
+++ b/_alp/Classes/Class.Solarfarm_data.java
@@ -17,6 +17,8 @@ public class Solarfarm_data {
String city;
String gridnode_id;
boolean initially_active;
+ OL_Orientation orientation;
+ double tilt_angle_deg;
boolean isSliderGC;
double capacity_electric_kw;
double connection_capacity_kw;
From bfc1150c2660a8124f4c7f6bf686957cca99f2f0 Mon Sep 17 00:00:00 2001
From: Bas
Date: Tue, 17 Mar 2026 18:13:31 +0100
Subject: [PATCH 2/3] Use of OL_PVOrientation for PV assets
Removed roof pitch/tilt angle parameters.
Changed OL_Orientation into OL_PVOrientation
Small renaming in engine profiles
---
_alp/Agents/Zero_Loader/Code/Functions.java | 53 ++++++++-----------
_alp/Agents/Zero_Loader/Code/Functions.xml | 42 ++++-----------
.../Agents/tabElectricity/Code/Functions.java | 20 ++++++-
_alp/Agents/tabElectricity/Code/Functions.xml | 20 +++++++
_alp/Classes/Class.Building_data.java | 3 +-
_alp/Classes/Class.Solarfarm_data.java | 3 +-
6 files changed, 73 insertions(+), 68 deletions(-)
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java
index de2e4eca..bbbb5005 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.java
+++ b/_alp/Agents/Zero_Loader/Code/Functions.java
@@ -260,7 +260,6 @@ else if(RegionCoords.startsWith("LineString")){
solarpark = energyModel.add_EnergyProductionSites();
solarpark.set_p_gridConnectionID( dataSolarfarm.gc_id() );
-
//Set Address
solarpark.p_address = new J_Address(dataSolarfarm.streetname(),
dataSolarfarm.house_number(),
@@ -304,7 +303,7 @@ else if(RegionCoords.startsWith("LineString")){
}
}
if(gridNodeProfileLoaderType != OL_GridNodeProfileLoaderType.INCLUDE_PV || gridNodeProfileLoaderType != OL_GridNodeProfileLoaderType.NET_LOAD){
- f_addPVProductionAsset(solarpark, "Solar farm" , dataSolarfarm.capacity_electric_kw(), dataSolarfarm.orientation(), dataSolarfarm.tilt_angle_deg());
+ f_addPVProductionAsset(solarpark, "Solar farm" , dataSolarfarm.capacity_electric_kw(), dataSolarfarm.orientation());
//f_addEnergyProduction(solarpark, OL_EnergyAssetType.PHOTOVOLTAIC, "Solar farm" , dataSolarfarm.capacity_electric_kw());
}
@@ -1531,7 +1530,7 @@ else if (vehicle_type == OL_EnergyAssetType.PETROLEUM_FUEL_VAN){
pv_installed_kwp = 0.0;
}
if(pv_installed_kwp != null && pv_installed_kwp > 0){
- f_addPVProductionAsset(companyGC, "Rooftop Solar", pv_installed_kwp, OL_Orientation.SOUTH, 35.0);
+ f_addPVProductionAsset(companyGC, "Rooftop Solar", pv_installed_kwp, OL_PVOrientation.SOUTH);
//f_addEnergyProduction(companyGC, OL_EnergyAssetType.PHOTOVOLTAIC, "Rooftop Solar", pv_installed_kwp);
current_scenario_list.setCurrentPV_kW(roundToInt(pv_installed_kwp));
@@ -2370,7 +2369,7 @@ else if(!settings.createCurrentElectricityEA()){//input boolean: Dont create cur
current_scenario_list.setCurrentPV_kW(gridConnection.getSupply().getPvInstalledKwp());
} else if (gridConnection.getSupply().getPvInstalledKwp() != null && gridConnection.getSupply().getPvInstalledKwp() > 0){
//gridConnection.getSupply().getPvOrientation(); // Wat doen we hier mee????? Nog niets!
- f_addPVProductionAsset(companyGC, "Rooftop Solar", (double) gridConnection.getSupply().getPvInstalledKwp(), OL_Orientation.SOUTH, 35.0); //NEEDS FIXING
+ f_addPVProductionAsset(companyGC, "Rooftop Solar", (double) gridConnection.getSupply().getPvInstalledKwp(), OL_PVOrientation.SOUTH); //NEEDS FIXING
//f_addEnergyProduction(companyGC, OL_EnergyAssetType.PHOTOVOLTAIC, "Rooftop Solar", gridConnection.getSupply().getPvInstalledKwp());
//add to scenario: current
@@ -2986,6 +2985,8 @@ GridNode f_createHeatGridNode()
gridnode_id(gridNodeID).
initially_active(false).
+orientation(OL_PVOrientation.SOUTH).
+
capacity_electric_kw(0.0).
connection_capacity_kw(0.0).
contracted_delivery_capacity_kw(0.0).
@@ -3148,8 +3149,8 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl
//Create Weather engine profiles
energyModel.pp_ambientTemperature_degC = f_createEngineProfile("ambient_temperature_degC", a_arguments_hr, a_ambientTemperatureProfile_degC, OL_ProfileUnits.TEMPERATURE_DEGC);
-energyModel.pp_PVProduction35DegSouth_fr = f_createEngineProfile("pv_production_south_fr", a_arguments_hr, a_PVProductionProfile35DegSouth_fr, OL_ProfileUnits.NORMALIZEDPOWER);
-energyModel.pp_PVProduction15DegEastWest_fr = f_createEngineProfile("pv_production_eastwest_fr", a_arguments_hr, a_PVProductionProfile15DegEastWest_fr, OL_ProfileUnits.NORMALIZEDPOWER);
+energyModel.pp_PVProduction35DegSouth_fr = f_createEngineProfile("pv_production_35degsouth_fr", a_arguments_hr, a_PVProductionProfile35DegSouth_fr, OL_ProfileUnits.NORMALIZEDPOWER);
+energyModel.pp_PVProduction15DegEastWest_fr = f_createEngineProfile("pv_production_15degeastwest_fr", a_arguments_hr, a_PVProductionProfile15DegEastWest_fr, OL_ProfileUnits.NORMALIZEDPOWER);
energyModel.pp_windProduction_fr = f_createEngineProfile("wind_production_fr", a_arguments_hr, a_windProductionProfile_fr, OL_ProfileUnits.NORMALIZEDPOWER);
//Create Epex engine profile
@@ -3261,7 +3262,7 @@ else if (maxFeedin_kWh > 0 && !isPvPowerKnownAndPositive){
pvPower_kW = 2.5 * (maxFeedin_kWh/energyModel.p_timeParameters.getTimeStep_h()); // Estimation needed for pv power
traceln("PV Power has been estimated!");
f_createPreprocessedElectricityProfile_PV(GC_GridNode_profile, a_yearlyElectricityDelivery_kWh, a_yearlyElectricityFeedin_kWh, null, pvPower_kW, null);
- f_addPVProductionAsset(GC_GridNode_profile, "Total current Solar on GridNode", pvPower_kW, OL_Orientation.SOUTH, 35.0);
+ f_addPVProductionAsset(GC_GridNode_profile, "Total current Solar on GridNode", pvPower_kW, OL_PVOrientation.SOUTH);
//f_addEnergyProduction(GC_GridNode_profile, OL_EnergyAssetType.PHOTOVOLTAIC, "Total current Solar on GridNode", pvPower_kW);
}
else { //EXCLUDE_PV
@@ -3274,7 +3275,7 @@ else if (maxFeedin_kWh > 0 && !isPvPowerKnownAndPositive){
}
f_createPreprocessedElectricityProfile_PV(GC_GridNode_profile, a_yearlyElectricityDelivery_kWh, a_yearlyElectricityFeedin_kWh, null, pvPower_kW, null);
if (gridnode.p_profileType == OL_GridNodeProfileLoaderType.INCLUDE_PV){
- f_addPVProductionAsset(GC_GridNode_profile, "Total current Solar on GridNode", pvPower_kW, OL_Orientation.SOUTH, 35.0);
+ f_addPVProductionAsset(GC_GridNode_profile, "Total current Solar on GridNode", pvPower_kW, OL_PVOrientation.SOUTH);
//f_addEnergyProduction(GC_GridNode_profile, OL_EnergyAssetType.PHOTOVOLTAIC, "Total current Solar on GridNode", pvPower_kW);
}
}
@@ -3576,7 +3577,7 @@ else if (houseBuildingData.insulation_label() != null) {
GCH.v_liveAssetsMetaData.PVPotential_kW = GCH.v_liveAssetsMetaData.initialPV_kW > 0 ? GCH.v_liveAssetsMetaData.initialPV_kW : houseBuildingData.pv_potential_kwp(); // To prevent sliders from changing outcomes
//Create and add EnergyAssets
- f_addEnergyAssetsToHouses(GCH, houseBuildingData.electricity_consumption_kwhpa(), houseBuildingData.gas_consumption_m3pa(), houseBuildingData.heating_type(), houseBuildingData.cooking_type(), houseBuildingData.roof_orientation(), houseBuildingData.roof_pitch_deg());
+ f_addEnergyAssetsToHouses(GCH, houseBuildingData.electricity_consumption_kwhpa(), houseBuildingData.gas_consumption_m3pa(), houseBuildingData.heating_type(), houseBuildingData.cooking_type(), houseBuildingData.pv_orientation());
i++;
}
@@ -3591,7 +3592,7 @@ else if (houseBuildingData.insulation_label() != null) {
//traceln("Total space heat demand houses input " + roundToDecimal(totalSpaceHeatDemand_kwhpa/1000000,3) + "GWh");
/*ALCODEEND*/}
-double f_addEnergyAssetsToHouses(GCHouse house,Double electricityDemand_kwhpa,Double gasDemand_m3pa,OL_GridConnectionHeatingType heatingType,OL_HouseholdCookingMethod cookingType,OL_Orientation orientation,double roofPitch_deg)
+double f_addEnergyAssetsToHouses(GCHouse house,Double electricityDemand_kwhpa,Double gasDemand_m3pa,OL_GridConnectionHeatingType heatingType,OL_HouseholdCookingMethod cookingType,OL_PVOrientation pvOrientation)
{/*ALCODESTART::1749728889986*/
//Add generic electricity demand profile
GridNode gn = findFirst(energyModel.pop_gridNodes, x -> x.p_gridNodeID.equals( house.p_parentNodeElectricID));
@@ -3610,7 +3611,7 @@ else if (houseBuildingData.insulation_label() != null) {
//Add pv
-f_addPVToHouses(house, gn, orientation, roofPitch_deg);
+f_addPVToHouses(house, gn, pvOrientation);
//Add cars
f_addCarsToHouses(house);
@@ -5223,7 +5224,7 @@ Double f_getGNTotalPV_kWp(GridNode GN)
return totalPVPower_kW;
/*ALCODEEND*/}
-double f_addPVToHouses(GCHouse house,GridNode gn,OL_Orientation orientation,double roofPitch_deg)
+double f_addPVToHouses(GCHouse house,GridNode gn,OL_PVOrientation pvOrientation)
{/*ALCODESTART::1770037586816*/
double installedRooftopSolar_kW = house.v_liveAssetsMetaData.initialPV_kW != null ? house.v_liveAssetsMetaData.initialPV_kW : 0;
@@ -5232,39 +5233,29 @@ Double f_getGNTotalPV_kWp(GridNode GN)
}
if (installedRooftopSolar_kW > 0) {
- f_addPVProductionAsset(house, "Residential Solar", installedRooftopSolar_kW, orientation, roofPitch_deg);
+ f_addPVProductionAsset(house, "Residential Solar", installedRooftopSolar_kW, pvOrientation);
//f_addEnergyProduction(house, OL_EnergyAssetType.PHOTOVOLTAIC, "Residential Solar", installedRooftopSolar_kW);
}
/*ALCODEEND*/}
-double f_addPVProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW,OL_Orientation orientation,double roofPitch_deg)
+double f_addPVProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW,OL_PVOrientation pvOrientation)
{/*ALCODESTART::1773414911038*/
J_TimeParameters timeParameters = energyModel.p_timeParameters;
OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.ELECTRICITY;
-J_ProfilePointer profilePointer = f_determinePVTProfilePointer(orientation, roofPitch_deg);
+J_ProfilePointer profilePointer = f_getPVTProfilePointer(pvOrientation);
J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.PHOTOVOLTAIC, asset_name, energyCarrier, installedPower_kW, timeParameters, profilePointer);
/*ALCODEEND*/}
-J_ProfilePointer f_determinePVTProfilePointer(OL_Orientation orientation,double roofPitch_deg)
+J_ProfilePointer f_getPVTProfilePointer(OL_PVOrientation pvtOrientation)
{/*ALCODESTART::1773414911040*/
J_ProfilePointer profilePointer = null;
-switch (orientation){
+switch (pvtOrientation){
case EASTWEST:
- if (roofPitch_deg <= 15 && roofPitch_deg >= 0){
- profilePointer = energyModel.pp_PVProduction15DegEastWest_fr;
- }
- else {
- throw new RuntimeException("ProfilePointer for a combination of " + orientation + " and " + roofPitch_deg + " is not supported (yet)!");
- }
+ profilePointer = energyModel.pp_PVProduction15DegEastWest_fr;
case SOUTH:
- if (roofPitch_deg <= 35 && roofPitch_deg >= 0){
- profilePointer = energyModel.pp_PVProduction35DegSouth_fr;
- }
- else {
- throw new RuntimeException("ProfilePointer for a combination of " + orientation + " and " + roofPitch_deg + " is not supported (yet)!");
- }
+ profilePointer = energyModel.pp_PVProduction35DegSouth_fr;
}
return profilePointer;
@@ -5279,12 +5270,12 @@ J_ProfilePointer f_determinePVTProfilePointer(OL_Orientation orientation,double
J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.WINDMILL, asset_name, energyCarrier, installedPower_kW, timeParameters, profilePointer);
/*ALCODEEND*/}
-double f_addPTProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW,OL_Orientation orientation,int roofPitch_deg)
+double f_addPTProductionAsset(GridConnection parentGC,String asset_name,double installedPower_kW,OL_PVOrientation ptOrientation)
{/*ALCODESTART::1773414911044*/
//CONCEPT VERSION
J_TimeParameters timeParameters = energyModel.p_timeParameters;
OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.HEAT;
-J_ProfilePointer profilePointer = f_determinePVTProfilePointer(orientation, roofPitch_deg);
+J_ProfilePointer profilePointer = f_getPVTProfilePointer(ptOrientation);
J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.PHOTOVOLTAIC, asset_name, energyCarrier, installedPower_kW, timeParameters, profilePointer);
/*ALCODEEND*/}
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.xml b/_alp/Agents/Zero_Loader/Code/Functions.xml
index 536343ab..dd4e1180 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.xml
+++ b/_alp/Agents/Zero_Loader/Code/Functions.xml
@@ -1504,12 +1504,8 @@ verbruik = levering + productie - teruglevering]]>
-
-
-
-
-
-
+
+
@@ -2865,12 +2861,8 @@ verbruik = levering + productie - teruglevering]]>
-
-
-
-
-
-
+
+
@@ -2901,12 +2893,8 @@ verbruik = levering + productie - teruglevering]]>
-
-
-
-
-
-
+
+
@@ -2914,7 +2902,7 @@ verbruik = levering + productie - teruglevering]]>
RETURNS_VALUE
J_ProfilePointer
1773414911040
-
+
1530
220
@@ -2989,12 +2973,8 @@ verbruik = levering + productie - teruglevering]]>
-
-
-
-
-
-
+
+
diff --git a/_alp/Agents/tabElectricity/Code/Functions.java b/_alp/Agents/tabElectricity/Code/Functions.java
index a08771cb..9bf4c70c 100644
--- a/_alp/Agents/tabElectricity/Code/Functions.java
+++ b/_alp/Agents/tabElectricity/Code/Functions.java
@@ -75,7 +75,8 @@
if(house.v_liveAssetsMetaData.activeAssetFlows.contains(OL_AssetFlowCategories.ptProductionHeat_kW)){
installedPVCapacity_kW = max(0, installedPVCapacity_kW-zero_Interface.energyModel.avgc_data.p_avgPTPanelSize_m2*zero_Interface.energyModel.avgc_data.p_avgPVPower_kWpm2); //For now just 1 panel
}
- J_EAProduction productionAsset = new J_EAProduction ( house, OL_EnergyAssetType.PHOTOVOLTAIC, assetName, OL_EnergyCarriers.ELECTRICITY, installedPVCapacity_kW, zero_Interface.energyModel.p_timeParameters, zero_Interface.energyModel.pp_PVProduction35DegSouth_fr );
+ J_ProfilePointer profilePointer = f_getPVTProfilePointer(house.v_liveAssetsMetaData.PVOrientation);
+ J_EAProduction productionAsset = new J_EAProduction ( house, OL_EnergyAssetType.PHOTOVOLTAIC, assetName, OL_EnergyCarriers.ELECTRICITY, installedPVCapacity_kW, zero_Interface.energyModel.p_timeParameters, profilePointer );
houses.remove(house);
zero_Interface.c_orderedPVSystemsHouses.remove(house);
zero_Interface.c_orderedPVSystemsHouses.add(0, house);
@@ -271,7 +272,8 @@ Pair f_getPVSystemPercentage(List gcList)
double yearlyProductionHydrogen_kWh = 0.0;
double outputTemperature_degC = 0.0;
- J_EAProduction productionAsset = new J_EAProduction ( gc, assetType, assetName, OL_EnergyCarriers.ELECTRICITY, capacity_kWp, zero_Interface.energyModel.p_timeParameters, zero_Interface.energyModel.pp_PVProduction35DegSouth_fr );
+ J_ProfilePointer profilePointer = f_getPVTProfilePointer(gc.v_liveAssetsMetaData.PVOrientation);
+ J_EAProduction productionAsset = new J_EAProduction ( gc, assetType, assetName, OL_EnergyCarriers.ELECTRICITY, capacity_kWp, zero_Interface.energyModel.p_timeParameters, profilePointer );
}
// Update the ordered collection
@@ -753,3 +755,17 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){
}
/*ALCODEEND*/}
+J_ProfilePointer f_getPVTProfilePointer(OL_PVOrientation pvtOrientation)
+{/*ALCODESTART::1773764103422*/
+J_ProfilePointer profilePointer = null;
+
+switch (pvtOrientation){
+ case EASTWEST:
+ profilePointer = zero_Interface.energyModel.pp_PVProduction15DegEastWest_fr;
+ case SOUTH:
+ profilePointer = zero_Interface.energyModel.pp_PVProduction35DegSouth_fr;
+}
+
+return profilePointer;
+/*ALCODEEND*/}
+
diff --git a/_alp/Agents/tabElectricity/Code/Functions.xml b/_alp/Agents/tabElectricity/Code/Functions.xml
index 2b2e4ee8..894ebb8e 100644
--- a/_alp/Agents/tabElectricity/Code/Functions.xml
+++ b/_alp/Agents/tabElectricity/Code/Functions.xml
@@ -449,4 +449,24 @@
true
+
+ RETURNS_VALUE
+ J_ProfilePointer
+ 1773764103422
+
+ 400
+ 790
+
+ false
+ true
+ true
+
+
+
+
+
+
diff --git a/_alp/Classes/Class.Building_data.java b/_alp/Classes/Class.Building_data.java
index bfb31d61..7ade1b43 100644
--- a/_alp/Classes/Class.Building_data.java
+++ b/_alp/Classes/Class.Building_data.java
@@ -27,8 +27,7 @@ public class Building_data {
Double gas_consumption_m3pa;
Double pv_installed_kwp;
Double pv_potential_kwp;
- OL_Orientation roof_orientation;
- double roof_pitch_deg;
+ OL_PVOrientation pv_orientation;
OL_GridConnectionEnergyLabel energy_label;
Boolean has_private_parking;
String gridnode_id;
diff --git a/_alp/Classes/Class.Solarfarm_data.java b/_alp/Classes/Class.Solarfarm_data.java
index bce5a717..d5d7f9d0 100644
--- a/_alp/Classes/Class.Solarfarm_data.java
+++ b/_alp/Classes/Class.Solarfarm_data.java
@@ -17,8 +17,7 @@ public class Solarfarm_data {
String city;
String gridnode_id;
boolean initially_active;
- OL_Orientation orientation;
- double tilt_angle_deg;
+ OL_PVOrientation orientation;
boolean isSliderGC;
double capacity_electric_kw;
double connection_capacity_kw;
From 50f796f435b696081fdc6d1eb57d08542824c892 Mon Sep 17 00:00:00 2001
From: Bas
Date: Fri, 20 Mar 2026 10:14:41 +0100
Subject: [PATCH 3/3] Removed (now unnecessary) f_addEnergyProduction
---
_alp/Agents/Zero_Loader/Code/Functions.java | 32 --------
_alp/Agents/Zero_Loader/Code/Functions.xml | 87 +++++++--------------
2 files changed, 27 insertions(+), 92 deletions(-)
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java
index bbbb5005..73995a9c 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.java
+++ b/_alp/Agents/Zero_Loader/Code/Functions.java
@@ -1017,38 +1017,6 @@ GIS_Building f_createGISBuilding(Building_data buildingData,GridConnection paren
}
/*ALCODEEND*/}
-double f_addEnergyProduction(GridConnection parentGC,OL_EnergyAssetType asset_type,String asset_name,double installedPower_kW)
-{/*ALCODESTART::1726584205809*/
-double assetCapacity_kW = 0;
-J_TimeParameters timeParameters = energyModel.p_timeParameters;
-J_ProfilePointer profilePointer = null;
-OL_EnergyCarriers energyCarrier = OL_EnergyCarriers.ELECTRICITY;
-switch (asset_type){
-
-case PHOTOVOLTAIC:
- energyCarrier = OL_EnergyCarriers.ELECTRICITY;
- profilePointer = energyModel.pp_PVProduction35DegSouth_fr;
- assetCapacity_kW = installedPower_kW;
- break;
-
-case WINDMILL:
- energyCarrier = OL_EnergyCarriers.ELECTRICITY;
- profilePointer=energyModel.pp_windProduction_fr;
- assetCapacity_kW = installedPower_kW;
- break;
-
-case PHOTOTHERMAL: //NOT USED YET
- energyCarrier = OL_EnergyCarriers.HEAT;
- profilePointer = energyModel.pp_PVProduction35DegSouth_fr; // Voor nu om te testen! Misschien valt dit wel te gebruiken met bepaalde efficientie factor!
- assetCapacity_kW = installedPower_kW;
- break;
-}
-
-J_EAProduction production_asset = new J_EAProduction(parentGC, asset_type, asset_name, energyCarrier, assetCapacity_kW, timeParameters, profilePointer);
-
-
-/*ALCODEEND*/}
-
GIS_Object f_createGISObject(String name,double latitude,double longitude,String polygon,OL_GISObjectType GISObjectType)
{/*ALCODESTART::1726584205811*/
GIS_Object area = energyModel.add_pop_GIS_Objects();
diff --git a/_alp/Agents/Zero_Loader/Code/Functions.xml b/_alp/Agents/Zero_Loader/Code/Functions.xml
index dd4e1180..a6a185ca 100644
--- a/_alp/Agents/Zero_Loader/Code/Functions.xml
+++ b/_alp/Agents/Zero_Loader/Code/Functions.xml
@@ -315,39 +315,6 @@
true
-
- VOID
- double
- 1726584205809
-
- true
- 1320
- 190
-
- false
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
RETURNS_VALUE
GIS_Object
@@ -464,7 +431,7 @@
1726584205827
1320
- 620
+ 590