From 082e38d659c8af2699d7c419b4216721f0edca94 Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Thu, 29 Jan 2026 09:53:24 +0100 Subject: [PATCH 1/8] Intermediate save, engine and interface compile --- _alp/Agents/UI_company/Code/Functions.java | 6 +- _alp/Agents/UI_company/Levels/Level.level.xml | 4 +- _alp/Agents/Zero_Loader/Code/Functions.java | 157 ++++++++++++------ _alp/Agents/Zero_Loader/Code/Functions.xml | 4 + .../Agents/tabElectricity/Code/Functions.java | 8 +- _alp/Agents/tabHeating/Code/Functions.java | 14 +- 6 files changed, 124 insertions(+), 69 deletions(-) diff --git a/_alp/Agents/UI_company/Code/Functions.java b/_alp/Agents/UI_company/Code/Functions.java index ca36cd9b..2a1d2b9d 100644 --- a/_alp/Agents/UI_company/Code/Functions.java +++ b/_alp/Agents/UI_company/Code/Functions.java @@ -247,10 +247,10 @@ } else{ //Select profile heat demand asset - J_EAProfile heatDemandAsset_Profile = findFirst(GC.c_profileAssets, j_ea->j_ea.energyCarrier == OL_EnergyCarriers.HEAT); + J_EAProfile heatDemandAsset_Profile = findFirst(GC.c_profileAssets, j_ea->j_ea.getEnergyCarrier() == OL_EnergyCarriers.HEAT); if(heatDemandAsset_Profile != null){ - capacityThermal_kW = heatDemandAsset_Profile.getProfileScaling_fr() * max(heatDemandAsset_Profile.a_energyProfile_kWh)*4; + capacityThermal_kW = heatDemandAsset_Profile.getPeakPower_kW();//heatDemandAsset_Profile.getProfileScaling_fr() * max(heatDemandAsset_Profile.a_energyProfile_kWh)*4; } else{ traceln("No heating demand asset found for GC:" + GC.p_gridConnectionID); @@ -1600,7 +1600,7 @@ else if(setAmountOfVehicles < local_HydrogenV_nb){ // Slider has decreased the a currentHeatSavings = roundToInt((consumptionEAHEAT.getConsumptionScaling_fr() - 1)*-100); } else{ - J_EAProfile profileEAHEAT = findFirst(p_gridConnection.c_profileAssets, profileAsset -> profileAsset.energyCarrier == OL_EnergyCarriers.HEAT); + J_EAProfile profileEAHEAT = findFirst(p_gridConnection.c_profileAssets, profileAsset -> profileAsset.getEnergyCarrier() == OL_EnergyCarriers.HEAT); if (profileEAHEAT != null){ currentHeatSavings = roundToInt((profileEAHEAT.getProfileScaling_fr() - 1)*-100); } diff --git a/_alp/Agents/UI_company/Levels/Level.level.xml b/_alp/Agents/UI_company/Levels/Level.level.xml index 372c8ef2..aeb71f97 100644 --- a/_alp/Agents/UI_company/Levels/Level.level.xml +++ b/_alp/Agents/UI_company/Levels/Level.level.xml @@ -642,7 +642,7 @@ for (J_EA j_ea : p_gridConnection.c_energyAssets){ } } if (j_ea instanceof J_EAProfile) { - if (((J_EAProfile) j_ea).energyCarrier== OL_EnergyCarriers.HEAT) { + if (((J_EAProfile) j_ea).getEnergyCarrier()== OL_EnergyCarriers.HEAT) { ((J_EAProfile) j_ea).setProfileScaling_fr( consumptionScaling_fr ); } } @@ -820,7 +820,7 @@ for (J_EA j_ea : p_gridConnection.c_energyAssets) { } } if (j_ea instanceof J_EAProfile) { - if (((J_EAProfile) j_ea).energyCarrier == OL_EnergyCarriers.ELECTRICITY) { + if (((J_EAProfile) j_ea).getEnergyCarrier() == OL_EnergyCarriers.ELECTRICITY) { ((J_EAProfile) j_ea).setProfileScaling_fr( consumptionScaling_fr ); } } diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java index dd4e536b..10375118 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.java +++ b/_alp/Agents/Zero_Loader/Code/Functions.java @@ -1656,10 +1656,20 @@ else if (vehicle_type == OL_EnergyAssetType.HYDROGEN_VAN){ double f_addChargingDemandProfile(GCPublicCharger GC,String profileName) {/*ALCODESTART::1726584205845*/ -J_EAProfile profile = new J_EAProfile(GC, OL_EnergyCarriers.ELECTRICITY, null, OL_AssetFlowCategories.evChargingPower_kW, energyModel.p_timeStep_h); -profile.energyAssetName = "charging profile"; List quarterlyEnergyDemand_kWh = selectValues(double.class, "SELECT " + profileName + " FROM charging_profiles;"); -profile.a_energyProfile_kWh = quarterlyEnergyDemand_kWh.stream().mapToDouble(d -> max(0,d)).map( d -> d / 4).toArray(); +double[] profile_kWhpqh = quarterlyEnergyDemand_kWh.stream().mapToDouble(d -> max(0,d)).map( d -> d / 4).toArray(); + +double dataTimeStep_h = 0.25; +double[] a_arguments_hr = new double[profile_kWhpqh.length]; +for (int i = 0; i 0) { // When only delivery, feedin profiles are available, in addition to PV power, make explicit consumption and production arrays using delivery profile and PV installed power [kW] - double[] yearlyElectricityConsumption_kWh = new double[yearlyElectricityDelivery_kWh.length]; + if (yearlyElectricityFeedin_kWh != null) { // Terugleveringsdata beschikbaar //traceln("Estimating electricity consumption based on delivery and feedin profiles with pv power estimate for company %s with %s kWp PV", parentGC.p_gridConnectionID, pvPower_kW); double addedConsumption_kWh = 0; @@ -1913,10 +1925,10 @@ String f_createChargerPolygon(double lat,double lon) } //traceln("Added electricity consumed compared to delivery profile: %s MWh", addedConsumption_kWh/1000); } - profile.a_energyProfile_kWh = yearlyElectricityConsumption_kWh; + nettDelivery_kWh = Arrays.stream(yearlyElectricityDelivery_kWh).sum(); } else { // No PV production - profile.a_energyProfile_kWh = yearlyElectricityDelivery_kWh; + nettDelivery_kWh = Arrays.stream(yearlyElectricityDelivery_kWh).sum(); } @@ -1932,16 +1944,28 @@ String f_createChargerPolygon(double lat,double lon) for(int i = 0; i < yearlyHeatPumpElectricityConsumption_kWh.length; i++){ yearlyHeatPumpElectricityConsumption_kWh[i] = max(0,yearlyHeatPumpElectricityConsumption_kWh[i]); } - double[] preProcessedDefaultConsumptionProfile = new double[profile.a_energyProfile_kWh.length]; + double[] preProcessedDefaultConsumptionProfile = new double[yearlyElectricityConsumption_kWh.length]; for(int i = 0; i < preProcessedDefaultConsumptionProfile.length; i++){ - preProcessedDefaultConsumptionProfile[i] = max(0,profile.a_energyProfile_kWh[i] - yearlyHeatPumpElectricityConsumption_kWh[i]); + preProcessedDefaultConsumptionProfile[i] = max(0,yearlyElectricityConsumption_kWh[i] - yearlyHeatPumpElectricityConsumption_kWh[i]); } - profile.a_energyProfile_kWh = preProcessedDefaultConsumptionProfile; - - J_EAProfile profileHeatPumpElectricityConsumption = new J_EAProfile(parentGC, OL_EnergyCarriers.ELECTRICITY, yearlyHeatPumpElectricityConsumption_kWh, OL_AssetFlowCategories.heatPumpElectricityConsumption_kW, energyModel.p_timeStep_h); - profileHeatPumpElectricityConsumption.setStartTime_h(v_simStartHour_h); - profileHeatPumpElectricityConsumption.energyAssetName = parentGC.p_ownerID + " custom heat pump electricity consumption profile"; -} + //profile.a_energyProfile_kWh = preProcessedDefaultConsumptionProfile; + String heatpumpAssetName = parentGC.p_ownerID + " custom heat pump electricity consumption profile"; + J_ProfilePointer heatpumpProfilePointer = f_createEngineProfile(heatpumpAssetName, timeAxis_h, yearlyHeatPumpElectricityConsumption_kWh, OL_ProfileUnits.KWHPQUARTERHOUR); + J_EAProfile profileHeatPumpElectricityConsumption = new J_EAProfile(parentGC, OL_EnergyCarriers.ELECTRICITY, heatpumpProfilePointer, OL_AssetFlowCategories.heatPumpElectricityConsumption_kW, energyModel.p_timeStep_h); + //profileHeatPumpElectricityConsumption.setStartTime_h(v_simStartHour_h); + profileHeatPumpElectricityConsumption.energyAssetName = heatpumpAssetName; + yearlyElectricityConsumption_kWh = preProcessedDefaultConsumptionProfile; +} + +// Create the actual profile asset +String energyAssetName = parentGC.p_ownerID + " custom profile"; +J_ProfilePointer profilePointer = f_createEngineProfile(energyAssetName, timeAxis_h, yearlyElectricityConsumption_kWh, OL_ProfileUnits.KWHPQUARTERHOUR); +//Create the profile +J_EAProfile profile = new J_EAProfile(parentGC, OL_EnergyCarriers.ELECTRICITY, profilePointer, OL_AssetFlowCategories.fixedConsumptionElectric_kW, energyModel.p_timeStep_h); +//profile.setStartTime_h(v_simStartHour_h); +profile.energyAssetName = energyAssetName; + + /*ALCODEEND*/} double f_startUpLoader_default() @@ -2184,7 +2208,7 @@ else if(pvPower_kW != null && pvPower_kW > 0){ double[] a_normalizedPower_fr = Arrays.stream(yearlyElectricityProduction_kWh).map(i -> 4 * i / totalProduction_kWh * fullLoadHours_h ).toArray(); TableFunction tf_customPVproduction_fr = new TableFunction(a_arguments, a_normalizedPower_fr, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); -J_ProfilePointer profilePointer = new J_ProfilePointer((parentGC.p_ownerID + "_PVproduction") , tf_customPVproduction_fr); +J_ProfilePointer profilePointer = new J_ProfilePointer((parentGC.p_ownerID + "_PVproduction") , tf_customPVproduction_fr, OL_ProfileUnits.NORMALIZEDPOWER); energyModel.f_addProfile(profilePointer); J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.PHOTOVOLTAIC, (parentGC.p_ownerID + "_rooftopPV"), OL_EnergyCarriers.ELECTRICITY, (double)pvPower_kW, energyModel.p_timeStep_h, profilePointer); @@ -3105,10 +3129,10 @@ GridNode f_createHeatGridNode() } /*ALCODEEND*/} -J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,double[] values) +J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,double[] values,OL_ProfileUnits profileUnitType) {/*ALCODESTART::1749125189323*/ TableFunction tf_profile = new TableFunction(arguments, values, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); -J_ProfilePointer profilePointer = new J_ProfilePointer(profileID, tf_profile); +J_ProfilePointer profilePointer = new J_ProfilePointer(profileID, tf_profile, profileUnitType); energyModel.f_addProfile(profilePointer); return profilePointer; /*ALCODEEND*/} @@ -3135,25 +3159,24 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl double[] a_defaultBuildingHeatDemandProfile_fr = ListUtil.doubleListToArray(defaultProfiles_data.defaultBuildingHeatDemandProfile_fr()); //Create Weather engine profiles -energyModel.pp_ambientTemperature_degC = f_createEngineProfile("ambient_temperature_degC", a_arguments_hr, a_ambientTemperatureProfile_degC); -energyModel.pp_PVProduction35DegSouth_fr = f_createEngineProfile("pv_production_south_fr", a_arguments_hr, a_PVProductionProfile35DegSouth_fr); -energyModel.pp_PVProduction15DegEastWest_fr = f_createEngineProfile("pv_production_eastwest_fr", a_arguments_hr, a_PVProductionProfile15DegEastWest_fr); -energyModel.pp_windProduction_fr = f_createEngineProfile("wind_production_fr", a_arguments_hr, a_windProductionProfile_fr); +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_windProduction_fr = f_createEngineProfile("wind_production_fr", a_arguments_hr, a_windProductionProfile_fr, OL_ProfileUnits.NORMALIZEDPOWER); //Create Epex engine profile -energyModel.pp_dayAheadElectricityPricing_eurpMWh = f_createEngineProfile("epex_price_eurpMWh", a_arguments_hr, a_epexProfile_eurpMWh); +energyModel.pp_dayAheadElectricityPricing_eurpMWh = f_createEngineProfile("epex_price_eurpMWh", a_arguments_hr, a_epexProfile_eurpMWh, OL_ProfileUnits.PRICE_EURPMWH); //Create Consumption engine profiles: -f_createEngineProfile("default_house_electricity_demand_fr", a_arguments_hr, a_defaultHouseElectricityDemandProfile_fr); -f_createEngineProfile("default_house_hot_water_demand_fr", a_arguments_hr, a_defaultHouseHotWaterDemandProfile_fr); -f_createEngineProfile("default_house_cooking_demand_fr", a_arguments_hr, a_defaultHouseCookingDemandProfile_fr); -f_createEngineProfile("default_office_electricity_demand_fr", a_arguments_hr, a_defaultOfficeElectricityDemandProfile_fr); -f_createEngineProfile("default_building_heat_demand_fr", a_arguments_hr, a_defaultBuildingHeatDemandProfile_fr); - +f_createEngineProfile("default_house_electricity_demand_fr", a_arguments_hr, a_defaultHouseElectricityDemandProfile_fr, OL_ProfileUnits.YEARLYTOTALFRACTION); +f_createEngineProfile("default_house_hot_water_demand_fr", a_arguments_hr, a_defaultHouseHotWaterDemandProfile_fr, OL_ProfileUnits.YEARLYTOTALFRACTION); +f_createEngineProfile("default_house_cooking_demand_fr", a_arguments_hr, a_defaultHouseCookingDemandProfile_fr, OL_ProfileUnits.YEARLYTOTALFRACTION); +f_createEngineProfile("default_office_electricity_demand_fr", a_arguments_hr, a_defaultOfficeElectricityDemandProfile_fr, OL_ProfileUnits.YEARLYTOTALFRACTION); +f_createEngineProfile("default_building_heat_demand_fr", a_arguments_hr, a_defaultBuildingHeatDemandProfile_fr, OL_ProfileUnits.YEARLYTOTALFRACTION); //Create custom engine profiles for(CustomProfile_data customProfile : c_customProfiles_data){ - f_createEngineProfile(customProfile.customProfileID(), customProfile.getArgumentsArray(), customProfile.getValuesArray()); + f_createEngineProfile(customProfile.customProfileID(), customProfile.getArgumentsArray(), customProfile.getValuesArray(), OL_ProfileUnits.NORMALIZEDPOWER); // What type of profiles usually in custom profiles?? Custom production profiles? } /*ALCODEEND*/} @@ -4002,19 +4025,24 @@ else if (surveyGC.getNaturalGas().getHourlyDelivery_m3() != null && surveyGC.get double f_createGasProfileFromGasTS(GridConnection engineGC,com.zenmo.zummon.companysurvey.GridConnection surveyGC) {/*ALCODESTART::1753804393557*/ // Gas delivery profile in m3 -double[] profile_m3 = f_timeSeriesToQuarterHourlyDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3()); +double[] profile_m3ph = f_convertFloatArrayToDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3().getFlatDataPoints()); +// TODO: Check startdate of profile! Perhaps update vallum method to do so? +double[] a_arguments_hr = ListUtil.doubleListToArray(defaultProfiles_data.arguments_hr()); //Calculate yearly gas delivery -double yearlyGasDelivery_m3 = Arrays.stream(profile_m3).sum(); +double yearlyGasDelivery_m3pa = Arrays.stream(profile_m3ph).sum(); +String energyAssetName = engineGC.p_ownerID + " custom gas profile"; // We assume all delivery is consumption and convert m3 to kWh -ZeroMath.arrayMultiply(profile_m3, avgc_data.p_gas_kWhpm3); +double[] profile_kW = ZeroMath.arrayMultiply(profile_m3ph, avgc_data.p_gas_kWhpm3); +J_ProfilePointer profilePointer = f_createEngineProfile(energyAssetName, a_arguments_hr, profile_m3ph, OL_ProfileUnits.KW); + // Then we create the profile asset and name it -J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.METHANE, profile_m3, null, energyModel.p_timeStep_h); -j_ea.energyAssetName = engineGC.p_ownerID + " custom gas profile"; +J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.METHANE, profilePointer, null, energyModel.p_timeStep_h); +j_ea.energyAssetName = energyAssetName; if(engineGC.p_owner.p_detailedCompany){ - p_remainingTotals.adjustRemainingGasDeliveryCompanies_m3(engineGC, - yearlyGasDelivery_m3); + p_remainingTotals.adjustRemainingGasDeliveryCompanies_m3(engineGC, - yearlyGasDelivery_m3pa); } /*ALCODEEND*/} @@ -4135,25 +4163,31 @@ else if ( surveyGC.getNaturalGas().getAnnualDelivery_m3() != null && surveyGC.ge double f_createHeatProfileFromGasTS(GridConnection engineGC,com.zenmo.zummon.companysurvey.GridConnection surveyGC,OL_GridConnectionHeatingType heatingType) {/*ALCODESTART::1753949286953*/ // Gas profile -double[] profile_m3 = f_timeSeriesToQuarterHourlyDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3()); +double[] profile_m3ph = f_convertFloatArrayToDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3().getFlatDataPoints()); +// TODO: Check startdate of profile! Perhaps update vallum method to do so? + +double[] a_arguments_hr = ListUtil.doubleListToArray(defaultProfiles_data.arguments_hr()); -double yearlyGasDelivery_m3 = Arrays.stream(profile_m3).sum(); +double yearlyGasDelivery_m3pa = Arrays.stream(profile_m3ph).sum(); +String energyAssetName = engineGC.p_ownerID + " custom building heat profile"; // First check what the heat conversion efficiency is from gas double gasToHeatEfficiency = f_getGasToHeatEfficiency(heatingType); // Then check which part of the gas consumption is used for heating double ratioGasUsedForHeating = f_getRatioGasUsedForHeating(surveyGC); // Finally, multiply the gas profile with the total conversion factor to get the heat profile -double[] profile_kWh = ZeroMath.arrayMultiply(profile_m3, avgc_data.p_gas_kWhpm3 * gasToHeatEfficiency * ratioGasUsedForHeating); +double[] profile_kW = ZeroMath.arrayMultiply(profile_m3ph, avgc_data.p_gas_kWhpm3 * gasToHeatEfficiency * ratioGasUsedForHeating); +J_ProfilePointer profilePointer = f_createEngineProfile(energyAssetName, a_arguments_hr, profile_kW, OL_ProfileUnits.KW); + // Then we create the profile asset and name it -J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.HEAT, profile_kWh, null , energyModel.p_timeStep_h); -j_ea.energyAssetName = engineGC.p_ownerID + " custom building heat profile"; +J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.HEAT, profilePointer, null , energyModel.p_timeStep_h); +j_ea.energyAssetName = energyAssetName; if(engineGC.p_owner.p_detailedCompany){ - p_remainingTotals.adjustRemainingGasDeliveryCompanies_m3(engineGC, - yearlyGasDelivery_m3); + p_remainingTotals.adjustRemainingGasDeliveryCompanies_m3(engineGC, - yearlyGasDelivery_m3pa); } -return max(profile_m3)/energyModel.p_timeStep_h; +return max(profile_m3ph); /*ALCODEEND*/} double f_reconstructAgent(Agent agent,AgentArrayList pop,EnergyModel energyModel) @@ -4228,16 +4262,33 @@ else if ( surveyGC.getNaturalGas().getAnnualDelivery_m3() != null && surveyGC.ge double f_createHeatProfileFromHeatTS(GridConnection engineGC,com.zenmo.zummon.companysurvey.GridConnection surveyGC) {/*ALCODESTART::1753964366889*/ + +String energyAssetName = engineGC.p_ownerID + " custom heat profile"; // Heat profile -double[] profile = f_timeSeriesToQuarterHourlyDoubleArray(surveyGC.getHeat().getHeatDeliveryTimeSeries_kWh()); + +double[] profile_kWhpqh = f_convertFloatArrayToDoubleArray(surveyGC.getHeat().getHeatDeliveryTimeSeries_kWh().getFlatDataPoints()); +double[] a_arguments_hr; +double dataTimeStep_h; +if ( profile_kWhpqh.length > 10000) { // if longer than 10_000 values, conclude it's quarter-hourly data, not hourly + dataTimeStep_h = 0.25; + a_arguments_hr = new double[profile_kWhpqh.length]; + for (int i = 0; i + + + + diff --git a/_alp/Agents/tabElectricity/Code/Functions.java b/_alp/Agents/tabElectricity/Code/Functions.java index a679f749..7b6e04c0 100644 --- a/_alp/Agents/tabElectricity/Code/Functions.java +++ b/_alp/Agents/tabElectricity/Code/Functions.java @@ -135,7 +135,7 @@ } // Set Profile Assets for (J_EAProfile j_ea : gc.c_profileAssets) { - if (j_ea.energyCarrier == OL_EnergyCarriers.ELECTRICITY) { + if (j_ea.getEnergyCarrier() == OL_EnergyCarriers.ELECTRICITY) { j_ea.setProfileScaling_fr( scalingFactor ); } } @@ -461,7 +461,7 @@ else if(gr_electricitySliders_residential.isVisible()){ List profileEAs = findAll(GC.c_profileAssets, profile -> profile.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW); List consumptionEAs = findAll(GC.c_consumptionAssets, consumption -> consumption.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW); for(J_EAProfile profileEA : profileEAs){ - double baseConsumption_kWh = ZeroMath.arraySum(profileEA.a_energyProfile_kWh); + double baseConsumption_kWh = profileEA.getBaseConsumption_kWh(); //ZeroMath.arraySum(profileEA.a_energyProfile_kWh); totalBaseConsumption_kWh += baseConsumption_kWh; totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } @@ -570,7 +570,7 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){ List profileEAs = findAll(GC.c_profileAssets, profile -> profile.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW); List consumptionEAs = findAll(GC.c_consumptionAssets, consumption -> consumption.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW); for(J_EAProfile profileEA : profileEAs){ - double baseConsumption_kWh = ZeroMath.arraySum(profileEA.a_energyProfile_kWh); + double baseConsumption_kWh = profileEA.getBaseConsumption_kWh(); //ZeroMath.arraySum(profileEA.a_energyProfile_kWh); totalBaseConsumption_kWh += baseConsumption_kWh; totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } @@ -615,7 +615,7 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){ List profileEAs = findAll(GC.c_profileAssets, profile -> profile.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW); List consumptionEAs = findAll(GC.c_consumptionAssets, consumption -> consumption.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW); for(J_EAProfile profileEA : profileEAs){ - double baseConsumption_kWh = ZeroMath.arraySum(profileEA.a_energyProfile_kWh); + double baseConsumption_kWh = profileEA.getBaseConsumption_kWh();//ZeroMath.arraySum(profileEA.a_energyProfile_kWh); totalBaseConsumption_kWh += baseConsumption_kWh; totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } diff --git a/_alp/Agents/tabHeating/Code/Functions.java b/_alp/Agents/tabHeating/Code/Functions.java index 24256f4a..d19ef872 100644 --- a/_alp/Agents/tabHeating/Code/Functions.java +++ b/_alp/Agents/tabHeating/Code/Functions.java @@ -119,7 +119,7 @@ int f_setHeatingSystemsCompanies(List gcList,ShapeSlider sliderGasbur } // Set Profile Assets for (J_EAProfile j_ea : gc.c_profileAssets) { - if (j_ea.energyCarrier == OL_EnergyCarriers.HEAT) { + if (j_ea.getEnergyCarrier() == OL_EnergyCarriers.HEAT) { j_ea.setProfileScaling_fr( scalingFactor ); } } @@ -224,8 +224,8 @@ int f_setHeatingSystemsWithCompanyUI(List gcList,double targetHeatPum } } for (J_EAProfile j_ea : gc.c_profileAssets) { - if (j_ea.energyCarrier == OL_EnergyCarriers.HEAT) { - double maxValue = j_ea.getProfileScaling_fr() * Arrays.stream(j_ea.a_energyProfile_kWh).max().getAsDouble(); + if (j_ea.getEnergyCarrier() == OL_EnergyCarriers.HEAT) { + double maxValue = j_ea.getPeakPower_kW(); //j_ea.getProfileScaling_fr() * Arrays.stream(j_ea.a_energyProfile_kWh).max().getAsDouble(); peakHeatDemand_kW += maxValue / zero_Interface.energyModel.p_timeStep_h * j_ea.getProfileScaling_fr(); } } @@ -312,8 +312,8 @@ else if (house.p_BuildingThermalAsset != null){ } // Else house has a customprofiel else { - J_EAProfile heatDemandProfile = (J_EAProfile)findFirst(house.c_profileAssets, x->x instanceof J_EAProfile && x.energyCarrier == OL_EnergyCarriers.HEAT); - double peakHeatDemand_kW = heatDemandProfile.getProfileScaling_fr() * Arrays.stream(heatDemandProfile.a_energyProfile_kWh).max().orElseThrow(() -> new RuntimeException("Unable to find the maximum of the heat demand profile")); + J_EAProfile heatDemandProfile = (J_EAProfile)findFirst(house.c_profileAssets, x->x instanceof J_EAProfile && x.getEnergyCarrier() == OL_EnergyCarriers.HEAT); + double peakHeatDemand_kW = heatDemandProfile.getPeakPower_kW();//heatDemandProfile.getProfileScaling_fr() * Arrays.stream(heatDemandProfile.a_energyProfile_kWh).max().orElseThrow(() -> new RuntimeException("Unable to find the maximum of the heat demand profile")); gasBurner = new J_EAConversionGasBurner(house, peakHeatDemand_kW, 0.99, zero_Interface.energyModel.p_timeStep_h, 90); } house.f_addHeatManagement(OL_GridConnectionHeatingType.GAS_BURNER, false); @@ -710,7 +710,7 @@ else if(gr_heatingSliders_residential.isVisible()){ List profileEAs = findAll(GC.c_profileAssets, profile -> profile.getEnergyCarrier() == OL_EnergyCarriers.HEAT); List consumptionEAs = findAll(GC.c_consumptionAssets, consumption -> consumption.getActiveEnergyCarriers().contains(OL_EnergyCarriers.HEAT)); for(J_EAProfile profileEA : profileEAs){ - double baseConsumption_kWh = ZeroMath.arraySum(profileEA.a_energyProfile_kWh); + double baseConsumption_kWh = profileEA.getBaseConsumption_kWh(); //ZeroMath.arraySum(profileEA.a_energyProfile_kWh); totalBaseConsumption_kWh += baseConsumption_kWh; totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } @@ -935,7 +935,7 @@ else if(gr_heatingSliders_residential.isVisible()){ List profileEAs = findAll(GC.c_profileAssets, profile -> profile.getEnergyCarrier() == OL_EnergyCarriers.HEAT); // FIX FOR HOT WATER/PT IN LONG RUN List consumptionEAs = findAll(GC.c_consumptionAssets, consumption -> consumption.energyAssetType == OL_EnergyAssetType.HEAT_DEMAND); for(J_EAProfile profileEA : profileEAs){ - double baseConsumption_kWh = ZeroMath.arraySum(profileEA.a_energyProfile_kWh); + double baseConsumption_kWh = profileEA.getBaseConsumption_kWh(); //ZeroMath.arraySum(profileEA.a_energyProfile_kWh); totalBaseConsumption_kWh += baseConsumption_kWh; totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } From 50d7990880a416ec7f8927b92dae54620fb7cf0d Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Thu, 29 Jan 2026 11:21:37 +0100 Subject: [PATCH 2/8] Fixes after update from main --- _alp/Agents/UI_company/Code/Functions.java | 2 +- .../Agents/Zero_Interface/Code/Functions.java | 2 +- _alp/Agents/Zero_Loader/Code/Functions.java | 26 +++++++++---------- .../Agents/tabElectricity/Code/Functions.java | 16 ++++++------ _alp/Agents/tabHeating/Code/Functions.java | 12 ++++----- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/_alp/Agents/UI_company/Code/Functions.java b/_alp/Agents/UI_company/Code/Functions.java index fd344c49..5890c080 100644 --- a/_alp/Agents/UI_company/Code/Functions.java +++ b/_alp/Agents/UI_company/Code/Functions.java @@ -243,7 +243,7 @@ //Check heating demand asset is null (shouldnt be possible) if (heatDemandAsset != null){ - capacityThermal_kW = heatDemandAsset.yearlyDemand_kWh/8760*10; // --> average hourly consumption * 10 --> to always have enough capacity + capacityThermal_kW = heatDemandAsset.getYearlyDemand_kWh()/8760*10; // --> average hourly consumption * 10 --> to always have enough capacity } else{ //Select profile heat demand asset diff --git a/_alp/Agents/Zero_Interface/Code/Functions.java b/_alp/Agents/Zero_Interface/Code/Functions.java index eb2252b7..21dd504b 100644 --- a/_alp/Agents/Zero_Interface/Code/Functions.java +++ b/_alp/Agents/Zero_Interface/Code/Functions.java @@ -720,7 +720,7 @@ public void write(int b) { else{ for ( J_EAConsumption consumptionAsset : gc.c_consumptionAssets){ if( consumptionAsset.getEAType() == OL_EnergyAssetType.ELECTRICITY_DEMAND ){ - yearlyElectricityConsumption_kWh += consumptionAsset.yearlyDemand_kWh; + yearlyElectricityConsumption_kWh += consumptionAsset.getYearlyDemand_kWh(); } } } diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java index 147883ed..bc660341 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.java +++ b/_alp/Agents/Zero_Loader/Code/Functions.java @@ -1663,8 +1663,8 @@ else if (vehicle_type == OL_EnergyAssetType.HYDROGEN_VAN){ J_ProfilePointer profilePointer = f_createEngineProfile(energyAssetName, a_arguments_hr, profile_kWhpqh, OL_ProfileUnits.KWHPQUARTERHOUR); -J_EAProfile profile = new J_EAProfile(GC, OL_EnergyCarriers.ELECTRICITY, profilePointer, OL_AssetFlowCategories.evChargingPower_kW, energyModel.p_timeStep_h); -profile.energyAssetName = energyAssetName; +J_EAProfile profile = new J_EAProfile(GC, OL_EnergyCarriers.ELECTRICITY, profilePointer, OL_AssetFlowCategories.evChargingPower_kW, energyModel.p_timeParameters); +profile.setEnergyAssetName(energyAssetName); /*ALCODEEND*/} String f_createChargerPolygon(double lat,double lon) @@ -1873,7 +1873,7 @@ String f_createChargerPolygon(double lat,double lon) double[] yearlyElectricityConsumption_kWh = new double[yearlyElectricityDelivery_kWh.length]; double[] timeAxis_h = new double[yearlyElectricityDelivery_kWh.length]; for (int i = 0; i x.p_cookingMethod == OL_HouseholdCookingMethod.ELECTRIC); J_EAConsumption cookingAsset = findFirst(house.c_consumptionAssets, p -> p.getEAType() == OL_EnergyAssetType.ELECTRIC_HOB ); if (cookingAsset != null) { - double yearlyCookingDemand_kWh = cookingAsset.yearlyDemand_kWh; + double yearlyCookingDemand_kWh = cookingAsset.getYearlyDemand_kWh(); cookingAsset.removeEnergyAsset(); J_ProfilePointer pp = zero_Interface.energyModel.f_findProfile("default_house_hot_water_demand_fr"); @@ -407,7 +407,7 @@ else if ( gc instanceof GCUtility ) { else { J_EAConsumption cookingAsset = findFirst(house.c_consumptionAssets, p -> p.getEAType() == OL_EnergyAssetType.GAS_PIT ); if (cookingAsset != null) { - double yearlyCookingDemand_kWh = cookingAsset.yearlyDemand_kWh; + double yearlyCookingDemand_kWh = cookingAsset.getYearlyDemand_kWh(); cookingAsset.removeEnergyAsset(); new J_EAConsumption(house, OL_EnergyAssetType.ELECTRIC_HOB, "default_house_cooking_demand_fr", yearlyCookingDemand_kWh, OL_EnergyCarriers.ELECTRICITY, zero_Interface.energyModel.p_timeParameters, null); @@ -467,8 +467,8 @@ else if(gr_electricitySliders_residential.isVisible()){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.yearlyDemand_kWh; - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.yearlyDemand_kWh; + totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); } } } @@ -576,8 +576,8 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.yearlyDemand_kWh; - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.yearlyDemand_kWh; + totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); } } } @@ -621,8 +621,8 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.yearlyDemand_kWh; - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.yearlyDemand_kWh; + totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); } } } diff --git a/_alp/Agents/tabHeating/Code/Functions.java b/_alp/Agents/tabHeating/Code/Functions.java index 205958b2..2d74db16 100644 --- a/_alp/Agents/tabHeating/Code/Functions.java +++ b/_alp/Agents/tabHeating/Code/Functions.java @@ -220,7 +220,7 @@ int f_setHeatingSystemsWithCompanyUI(List gcList,double targetHeatPum if (j_ea.getEAType() == OL_EnergyAssetType.HEAT_DEMAND || j_ea.getEAType() == OL_EnergyAssetType.HOT_WATER_CONSUMPTION) { double[] profile = j_ea.getProfilePointer().getAllValues(); double maxFactor = Arrays.stream(profile).max().getAsDouble(); - peakHeatDemand_kW += maxFactor * j_ea.yearlyDemand_kWh * j_ea.getConsumptionScaling_fr(); + peakHeatDemand_kW += maxFactor * j_ea.getYearlyDemand_kWh() * j_ea.getConsumptionScaling_fr(); } } for (J_EAProfile j_ea : gc.c_profileAssets) { @@ -303,7 +303,7 @@ int f_setHeatingSystemsWithCompanyUI(List gcList,double targetHeatPum J_EAConversionGasBurner gasBurner; //if house has follows the general heat deamnd profile if (heatDemandAsset != null) { - gasBurner = new J_EAConversionGasBurner(house, heatDemandAsset.yearlyDemand_kWh/8760*10, 0.99, zero_Interface.energyModel.p_timeParameters, 90); + gasBurner = new J_EAConversionGasBurner(house, heatDemandAsset.getYearlyDemand_kWh()/8760*10, 0.99, zero_Interface.energyModel.p_timeParameters, 90); } //if house has a thermalBuildingAsset else if (house.p_BuildingThermalAsset != null){ @@ -715,8 +715,8 @@ else if(gr_heatingSliders_residential.isVisible()){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.yearlyDemand_kWh; - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.yearlyDemand_kWh; + totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); } if(GC.p_BuildingThermalAsset != null){ @@ -940,8 +940,8 @@ else if(gr_heatingSliders_residential.isVisible()){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.yearlyDemand_kWh; - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.yearlyDemand_kWh; + totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); } if(GC.p_BuildingThermalAsset != null){ From e54ef44b0a0f51ae965af77364731e2813c83b98 Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Thu, 29 Jan 2026 13:46:09 +0100 Subject: [PATCH 3/8] Fixes for J_EAProfile refactor --- _alp/Agents/UI_company/Levels/Level.level.xml | 6 ++---- _alp/Agents/Zero_Loader/Code/Functions.java | 19 +++++++++++++++---- _alp/Agents/tabHeating/Code/Functions.java | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/_alp/Agents/UI_company/Levels/Level.level.xml b/_alp/Agents/UI_company/Levels/Level.level.xml index e3eaf533..28b5fe67 100644 --- a/_alp/Agents/UI_company/Levels/Level.level.xml +++ b/_alp/Agents/UI_company/Levels/Level.level.xml @@ -640,8 +640,7 @@ for (J_EA j_ea : p_gridConnection.c_energyAssets){ if (j_ea.getEAType() == OL_EnergyAssetType.HEAT_DEMAND) { ((J_EAConsumption)j_ea).setConsumptionScaling_fr(consumptionScaling_fr); } - } - if (j_ea instanceof J_EAProfile) { + } else if (j_ea instanceof J_EAProfile && !(j_ea instanceof J_EAProduction)) { if (((J_EAProfile) j_ea).getEnergyCarrier()== OL_EnergyCarriers.HEAT) { ((J_EAProfile) j_ea).setProfileScaling_fr( consumptionScaling_fr ); } @@ -818,8 +817,7 @@ for (J_EA j_ea : p_gridConnection.c_energyAssets) { if (j_ea.getEAType() == OL_EnergyAssetType.ELECTRICITY_DEMAND) { ((J_EAConsumption)j_ea).setConsumptionScaling_fr(consumptionScaling_fr); } - } - if (j_ea instanceof J_EAProfile) { + } else if (j_ea instanceof J_EAProfile && !(j_ea instanceof J_EAProduction)) { if (((J_EAProfile) j_ea).getEnergyCarrier() == OL_EnergyCarriers.ELECTRICITY) { ((J_EAProfile) j_ea).setProfileScaling_fr( consumptionScaling_fr ); } diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java index bc660341..76163fc9 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.java +++ b/_alp/Agents/Zero_Loader/Code/Functions.java @@ -1922,7 +1922,7 @@ String f_createChargerPolygon(double lat,double lon) nettDelivery_kWh = Arrays.stream(yearlyElectricityDelivery_kWh).sum(); } else { // No PV production - + yearlyElectricityConsumption_kWh=yearlyElectricityDelivery_kWh; nettDelivery_kWh = Arrays.stream(yearlyElectricityDelivery_kWh).sum(); } @@ -3170,7 +3170,7 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl //Create custom engine profiles for(CustomProfile_data customProfile : c_customProfiles_data){ - f_createEngineProfile(customProfile.customProfileID(), customProfile.getArgumentsArray(), customProfile.getValuesArray(), OL_ProfileUnits.NORMALIZEDPOWER); // What type of profiles usually in custom profiles?? Custom production profiles? + f_createEngineProfile(customProfile.customProfileID(), customProfile.getArgumentsArray(), customProfile.getValuesArray(), OL_ProfileUnits.KWHPQUARTERHOUR); // What type of profiles usually in custom profiles?? Custom production profiles? } /*ALCODEEND*/} @@ -4022,7 +4022,12 @@ else if (surveyGC.getNaturalGas().getHourlyDelivery_m3() != null && surveyGC.get double[] profile_m3ph = f_convertFloatArrayToDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3().getFlatDataPoints()); // TODO: Check startdate of profile! Perhaps update vallum method to do so? -double[] a_arguments_hr = ListUtil.doubleListToArray(defaultProfiles_data.arguments_hr()); +traceln("Gas data array length: %s", profile_m3ph.length); +double dataTimeStep_h = 1.0; +double[] a_arguments_hr = new double[profile_m3ph.length]; +for (int i = 0; ix instanceof J_EAProfile && x.getEnergyCarrier() == OL_EnergyCarriers.HEAT); + J_EAProfile heatDemandProfile = (J_EAProfile)findFirst(house.c_profileAssets, x->x instanceof J_EAProfile && x.getEnergyCarrier() == OL_EnergyCarriers.HEAT && !(x instanceof J_EAProduction)); double peakHeatDemand_kW = heatDemandProfile.getPeakPower_kW();//heatDemandProfile.getProfileScaling_fr() * Arrays.stream(heatDemandProfile.a_energyProfile_kWh).max().orElseThrow(() -> new RuntimeException("Unable to find the maximum of the heat demand profile")); gasBurner = new J_EAConversionGasBurner(house, peakHeatDemand_kW, 0.99, zero_Interface.energyModel.p_timeParameters, 90); } From e2d4f998bdb50ad072053715d9ce19c147d7ca51 Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Tue, 3 Feb 2026 09:00:34 +0100 Subject: [PATCH 4/8] Refactor for new constructor of J_EAProfile without tableFunction. And some minor updates to slider code getters for profile yearly consumption. --- _alp/Agents/UI_EnergyHub/Code/Functions.java | 4 +- _alp/Agents/UI_company/Code/Functions.java | 4 +- .../Agents/Zero_Interface/Code/Functions.java | 2 +- _alp/Agents/Zero_Loader/Code/Functions.java | 89 +++++++++++-------- _alp/Agents/Zero_Loader/Code/Functions.xml | 24 ----- .../Agents/tabElectricity/Code/Functions.java | 16 ++-- _alp/Agents/tabHeating/Code/Functions.java | 26 +++--- 7 files changed, 79 insertions(+), 86 deletions(-) diff --git a/_alp/Agents/UI_EnergyHub/Code/Functions.java b/_alp/Agents/UI_EnergyHub/Code/Functions.java index a4787d30..60e55a79 100644 --- a/_alp/Agents/UI_EnergyHub/Code/Functions.java +++ b/_alp/Agents/UI_EnergyHub/Code/Functions.java @@ -263,10 +263,10 @@ else if (members.size() > 8) { f_reconstructGIS_Objects(deserializedEnergyModel, saveObject.c_GISObjects); // Get profilePointer tableFunctions from 'original' energyModel - deserializedEnergyModel.c_profiles.forEach(x->{ + /* deserializedEnergyModel.c_profiles.forEach(x->{ J_ProfilePointer origProfile = zero_Interface.energyModel.f_findProfile(x.name); x.setTableFunction(origProfile.getTableFunction()); - }); + }); */ // get heatingTypeHashmap from 'old' energyModel. deserializedEnergyModel.c_defaultHeatingStrategies = zero_Interface.energyModel.c_defaultHeatingStrategies; diff --git a/_alp/Agents/UI_company/Code/Functions.java b/_alp/Agents/UI_company/Code/Functions.java index 5890c080..b35a478d 100644 --- a/_alp/Agents/UI_company/Code/Functions.java +++ b/_alp/Agents/UI_company/Code/Functions.java @@ -243,14 +243,14 @@ //Check heating demand asset is null (shouldnt be possible) if (heatDemandAsset != null){ - capacityThermal_kW = heatDemandAsset.getYearlyDemand_kWh()/8760*10; // --> average hourly consumption * 10 --> to always have enough capacity + capacityThermal_kW = heatDemandAsset.getBaseConsumption_kWh()/8760*10; // --> average hourly consumption * 10 --> to always have enough capacity } else{ //Select profile heat demand asset J_EAProfile heatDemandAsset_Profile = findFirst(GC.c_profileAssets, j_ea->j_ea.getEnergyCarrier() == OL_EnergyCarriers.HEAT); if(heatDemandAsset_Profile != null){ - capacityThermal_kW = heatDemandAsset_Profile.getPeakPower_kW();//heatDemandAsset_Profile.getProfileScaling_fr() * max(heatDemandAsset_Profile.a_energyProfile_kWh)*4; + capacityThermal_kW = heatDemandAsset_Profile.getPeakConsumptionPower_kW();//heatDemandAsset_Profile.getProfileScaling_fr() * max(heatDemandAsset_Profile.a_energyProfile_kWh)*4; } else{ traceln("No heating demand asset found for GC:" + GC.p_gridConnectionID); diff --git a/_alp/Agents/Zero_Interface/Code/Functions.java b/_alp/Agents/Zero_Interface/Code/Functions.java index 21dd504b..5e453537 100644 --- a/_alp/Agents/Zero_Interface/Code/Functions.java +++ b/_alp/Agents/Zero_Interface/Code/Functions.java @@ -720,7 +720,7 @@ public void write(int b) { else{ for ( J_EAConsumption consumptionAsset : gc.c_consumptionAssets){ if( consumptionAsset.getEAType() == OL_EnergyAssetType.ELECTRICITY_DEMAND ){ - yearlyElectricityConsumption_kWh += consumptionAsset.getYearlyDemand_kWh(); + yearlyElectricityConsumption_kWh += consumptionAsset.getBaseConsumption_kWh(); } } } diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java index 76163fc9..a4de64c9 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.java +++ b/_alp/Agents/Zero_Loader/Code/Functions.java @@ -1649,24 +1649,6 @@ else if (vehicle_type == OL_EnergyAssetType.HYDROGEN_VAN){ } /*ALCODEEND*/} -double f_addChargingDemandProfile(GCPublicCharger GC,String profileName) -{/*ALCODESTART::1726584205845*/ -List quarterlyEnergyDemand_kWh = selectValues(double.class, "SELECT " + profileName + " FROM charging_profiles;"); -double[] profile_kWhpqh = quarterlyEnergyDemand_kWh.stream().mapToDouble(d -> max(0,d)).map( d -> d / 4).toArray(); - -double dataTimeStep_h = 0.25; -double[] a_arguments_hr = new double[profile_kWhpqh.length]; -for (int i = 0; i 0){ double fullLoadHours_h = totalProduction_kWh / pvPower_kW; double[] a_normalizedPower_fr = Arrays.stream(yearlyElectricityProduction_kWh).map(i -> 4 * i / totalProduction_kWh * fullLoadHours_h ).toArray(); -TableFunction tf_customPVproduction_fr = new TableFunction(a_arguments, a_normalizedPower_fr, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); -J_ProfilePointer profilePointer = new J_ProfilePointer((parentGC.p_ownerID + "_PVproduction") , tf_customPVproduction_fr, OL_ProfileUnits.NORMALIZEDPOWER); +//TableFunction tf_customPVproduction_fr = new TableFunction(a_arguments, a_normalizedPower_fr, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); +//J_ProfilePointer profilePointer = new J_ProfilePointer((parentGC.p_ownerID + "_PVproduction") , tf_customPVproduction_fr, OL_ProfileUnits.NORMALIZEDPOWER); +double dataTimeStep_h = 0.25; +double dataStartTime_h = 0.0; +J_ProfilePointer profilePointer = new J_ProfilePointer((parentGC.p_ownerID + "_PVproduction") , a_normalizedPower_fr, dataTimeStep_h, dataStartTime_h, OL_ProfileUnits.NORMALIZEDPOWER); energyModel.f_addProfile(profilePointer); J_EAProduction production_asset = new J_EAProduction(parentGC, OL_EnergyAssetType.PHOTOVOLTAIC, (parentGC.p_ownerID + "_rooftopPV"), OL_EnergyCarriers.ELECTRICITY, (double)pvPower_kW, energyModel.p_timeParameters, profilePointer); @@ -3125,8 +3110,29 @@ GridNode f_createHeatGridNode() J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,double[] values,OL_ProfileUnits profileUnitType) {/*ALCODESTART::1749125189323*/ -TableFunction tf_profile = new TableFunction(arguments, values, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); -J_ProfilePointer profilePointer = new J_ProfilePointer(profileID, tf_profile, profileUnitType); +double dataTimeStep_h = (arguments[arguments.length-1] - arguments[0])/(arguments.length-1); +double dataStartTime_h = arguments[0]; +double timeStep_h = settings.timeStep_h; +double a_profile[]; +if (timeStep_h < dataTimeStep_h) { //Interpolate data to timeStep_h = 0.25 + //traceln("***** profilePointer using tableFunction to interpolate hourly data into quarter-hourly data ********"); + if ((dataTimeStep_h/timeStep_h)%1.0 != 0.0) { + throw new RuntimeException("dataTimeStep_h and modelTimeStep are not integer multiples! Unsupported dataformat!"); + } + TableFunction tableFunction = new TableFunction(arguments, values, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); + a_profile = new double[values.length*(int)(dataTimeStep_h/timeStep_h)]; + for (int i=0; i dataTimeStep_h) { + throw new RuntimeException("dataTimeStep_h smaller than modelTimeStep! Unsupported dataformat! Need to implement downsampling to allow this"); +} else { + a_profile=values; +} + +J_ProfilePointer profilePointer = new J_ProfilePointer(profileID, a_profile, dataTimeStep_h, dataStartTime_h, profileUnitType); + energyModel.f_addProfile(profilePointer); return profilePointer; /*ALCODEEND*/} @@ -4019,22 +4025,24 @@ else if (surveyGC.getNaturalGas().getHourlyDelivery_m3() != null && surveyGC.get double f_createGasProfileFromGasTS(GridConnection engineGC,com.zenmo.zummon.companysurvey.GridConnection surveyGC) {/*ALCODESTART::1753804393557*/ // Gas delivery profile in m3 -double[] profile_m3ph = f_convertFloatArrayToDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3().getFlatDataPoints()); +//double[] profile_m3ph = f_convertFloatArrayToDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3().getFlatDataPoints()); +double[] profile_m3pqh = f_timeSeriesToQuarterHourlyDoubleArray(surveyGC.getNaturalGas().getHourlyDelivery_m3()); + // TODO: Check startdate of profile! Perhaps update vallum method to do so? -traceln("Gas data array length: %s", profile_m3ph.length); -double dataTimeStep_h = 1.0; -double[] a_arguments_hr = new double[profile_m3ph.length]; -for (int i = 0; i 10000) { // if longer than 10_000 values, conclude it's quarter-hourly data, not hourly diff --git a/_alp/Agents/Zero_Loader/Code/Functions.xml b/_alp/Agents/Zero_Loader/Code/Functions.xml index 88bd1256..8d9f62d4 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.xml +++ b/_alp/Agents/Zero_Loader/Code/Functions.xml @@ -630,30 +630,6 @@ - - VOID - double - 1726584205845 - - 1320 - 600 - - false - true - true - - - - - - - - - - RETURNS_VALUE String diff --git a/_alp/Agents/tabElectricity/Code/Functions.java b/_alp/Agents/tabElectricity/Code/Functions.java index 91af41d2..51948e68 100644 --- a/_alp/Agents/tabElectricity/Code/Functions.java +++ b/_alp/Agents/tabElectricity/Code/Functions.java @@ -386,7 +386,7 @@ else if ( gc instanceof GCUtility ) { GCHouse house = randomWhere(gcListHouses, x -> x.p_cookingMethod == OL_HouseholdCookingMethod.ELECTRIC); J_EAConsumption cookingAsset = findFirst(house.c_consumptionAssets, p -> p.getEAType() == OL_EnergyAssetType.ELECTRIC_HOB ); if (cookingAsset != null) { - double yearlyCookingDemand_kWh = cookingAsset.getYearlyDemand_kWh(); + double yearlyCookingDemand_kWh = cookingAsset.getBaseConsumption_kWh(); cookingAsset.removeEnergyAsset(); J_ProfilePointer pp = zero_Interface.energyModel.f_findProfile("default_house_hot_water_demand_fr"); @@ -407,7 +407,7 @@ else if ( gc instanceof GCUtility ) { else { J_EAConsumption cookingAsset = findFirst(house.c_consumptionAssets, p -> p.getEAType() == OL_EnergyAssetType.GAS_PIT ); if (cookingAsset != null) { - double yearlyCookingDemand_kWh = cookingAsset.getYearlyDemand_kWh(); + double yearlyCookingDemand_kWh = cookingAsset.getBaseConsumption_kWh(); cookingAsset.removeEnergyAsset(); new J_EAConsumption(house, OL_EnergyAssetType.ELECTRIC_HOB, "default_house_cooking_demand_fr", yearlyCookingDemand_kWh, OL_EnergyCarriers.ELECTRICITY, zero_Interface.energyModel.p_timeParameters, null); @@ -467,8 +467,8 @@ else if(gr_electricitySliders_residential.isVisible()){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); + totalBaseConsumption_kWh += consumptionEA.getBaseConsumption_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getBaseConsumption_kWh(); } } } @@ -576,8 +576,8 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); + totalBaseConsumption_kWh += consumptionEA.getBaseConsumption_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getBaseConsumption_kWh(); } } } @@ -621,8 +621,8 @@ else if(productionEA.getEAType() == OL_EnergyAssetType.WINDMILL){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); + totalBaseConsumption_kWh += consumptionEA.getBaseConsumption_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getBaseConsumption_kWh(); } } } diff --git a/_alp/Agents/tabHeating/Code/Functions.java b/_alp/Agents/tabHeating/Code/Functions.java index 80547397..4aaec618 100644 --- a/_alp/Agents/tabHeating/Code/Functions.java +++ b/_alp/Agents/tabHeating/Code/Functions.java @@ -216,17 +216,17 @@ int f_setHeatingSystemsWithCompanyUI(List gcList,double targetHeatPum double f_calculatePeakHeatDemand_kW(GridConnection gc) {/*ALCODESTART::1749116448649*/ double peakHeatDemand_kW = 0.0; -for (J_EAConsumption j_ea : gc.c_consumptionAssets) { +/*for (J_EAConsumption j_ea : gc.c_consumptionAssets) { if (j_ea.getEAType() == OL_EnergyAssetType.HEAT_DEMAND || j_ea.getEAType() == OL_EnergyAssetType.HOT_WATER_CONSUMPTION) { double[] profile = j_ea.getProfilePointer().getAllValues(); double maxFactor = Arrays.stream(profile).max().getAsDouble(); peakHeatDemand_kW += maxFactor * j_ea.getYearlyDemand_kWh() * j_ea.getConsumptionScaling_fr(); } -} +}*/ for (J_EAProfile j_ea : gc.c_profileAssets) { - if (j_ea.getEnergyCarrier() == OL_EnergyCarriers.HEAT) { - double maxValue = j_ea.getPeakPower_kW(); //j_ea.getProfileScaling_fr() * Arrays.stream(j_ea.a_energyProfile_kWh).max().getAsDouble(); - peakHeatDemand_kW += maxValue / zero_Interface.energyModel.p_timeParameters.getTimeStep_h() * j_ea.getProfileScaling_fr(); + if (j_ea.getEnergyCarrier() == OL_EnergyCarriers.HEAT && !(j_ea instanceof J_EAProduction)) { + //double maxPower_kW = j_ea.getPeakPower_kW(); //j_ea.getProfileScaling_fr() * Arrays.stream(j_ea.a_energyProfile_kWh).max().getAsDouble(); + peakHeatDemand_kW += j_ea.getPeakConsumptionPower_kW(); //maxValue / zero_Interface.energyModel.p_timeParameters.getTimeStep_h() * j_ea.getProfileScaling_fr(); } } if (gc.p_BuildingThermalAsset != null) { @@ -297,8 +297,13 @@ int f_setHeatingSystemsWithCompanyUI(List gcList,double targetHeatPum house.f_removeAllHeatingAssets(); house.p_parentNodeHeat = null; house.p_parentNodeHeatID = null; - + //add gasburner + double peakHeatDemand_kW = f_calculatePeakHeatDemand_kW(house); + new J_EAConversionGasBurner(house, peakHeatDemand_kW, zero_Interface.energyModel.avgc_data.p_avgEfficiencyGasBurner_fr, zero_Interface.energyModel.p_timeParameters, 90); + house.f_addHeatManagement(OL_GridConnectionHeatingType.GAS_BURNER, false); + + /* J_EAConsumption heatDemandAsset = findFirst(house.c_consumptionAssets, j_ea -> j_ea.getEAType() == OL_EnergyAssetType.HEAT_DEMAND); J_EAConversionGasBurner gasBurner; //if house has follows the general heat deamnd profile @@ -317,6 +322,7 @@ else if (house.p_BuildingThermalAsset != null){ gasBurner = new J_EAConversionGasBurner(house, peakHeatDemand_kW, 0.99, zero_Interface.energyModel.p_timeParameters, 90); } house.f_addHeatManagement(OL_GridConnectionHeatingType.GAS_BURNER, false); + */ } //Update variable to change to custom scenario @@ -715,8 +721,8 @@ else if(gr_heatingSliders_residential.isVisible()){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); + totalBaseConsumption_kWh += consumptionEA.getBaseConsumption_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getBaseConsumption_kWh(); } if(GC.p_BuildingThermalAsset != null){ @@ -940,8 +946,8 @@ else if(gr_heatingSliders_residential.isVisible()){ totalSavedConsumption_kWh += (1 - profileEA.getProfileScaling_fr()) * baseConsumption_kWh; } for(J_EAConsumption consumptionEA : consumptionEAs){ - totalBaseConsumption_kWh += consumptionEA.getYearlyDemand_kWh(); - totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getYearlyDemand_kWh(); + totalBaseConsumption_kWh += consumptionEA.getBaseConsumption_kWh(); + totalSavedConsumption_kWh += (1-consumptionEA.getConsumptionScaling_fr())*consumptionEA.getBaseConsumption_kWh(); } if(GC.p_BuildingThermalAsset != null){ From 9795f40b994931d220f75a0e5f7f3cb93c2d7e1d Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Tue, 3 Feb 2026 10:02:21 +0100 Subject: [PATCH 5/8] costum profiles now required profileUnits to create valid J_ProfilePointer. --- _alp/Agents/Zero_Loader/Code/Functions.java | 16 ++++++++-------- _alp/Classes/Class.CustomProfile_data.java | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java index a4de64c9..04208b60 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.java +++ b/_alp/Agents/Zero_Loader/Code/Functions.java @@ -3112,20 +3112,20 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl {/*ALCODESTART::1749125189323*/ double dataTimeStep_h = (arguments[arguments.length-1] - arguments[0])/(arguments.length-1); double dataStartTime_h = arguments[0]; -double timeStep_h = settings.timeStep_h; +double simTimeStep_h = settings.timeStep_h(); double a_profile[]; -if (timeStep_h < dataTimeStep_h) { //Interpolate data to timeStep_h = 0.25 +if (simTimeStep_h < dataTimeStep_h) { //Interpolate data to timeStep_h = 0.25 //traceln("***** profilePointer using tableFunction to interpolate hourly data into quarter-hourly data ********"); - if ((dataTimeStep_h/timeStep_h)%1.0 != 0.0) { + if ((dataTimeStep_h/simTimeStep_h)%1.0 != 0.0) { throw new RuntimeException("dataTimeStep_h and modelTimeStep are not integer multiples! Unsupported dataformat!"); } TableFunction tableFunction = new TableFunction(arguments, values, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); - a_profile = new double[values.length*(int)(dataTimeStep_h/timeStep_h)]; + a_profile = new double[values.length*(int)(dataTimeStep_h/simTimeStep_h)]; for (int i=0; i dataTimeStep_h) { + dataTimeStep_h = simTimeStep_h; +} else if (simTimeStep_h > dataTimeStep_h) { throw new RuntimeException("dataTimeStep_h smaller than modelTimeStep! Unsupported dataformat! Need to implement downsampling to allow this"); } else { a_profile=values; @@ -3176,7 +3176,7 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl //Create custom engine profiles for(CustomProfile_data customProfile : c_customProfiles_data){ - f_createEngineProfile(customProfile.customProfileID(), customProfile.getArgumentsArray(), customProfile.getValuesArray(), OL_ProfileUnits.KWHPQUARTERHOUR); // What type of profiles usually in custom profiles?? Custom production profiles? + f_createEngineProfile(customProfile.customProfileID(), customProfile.getArgumentsArray(), customProfile.getValuesArray(), customProfile.profileUnits()); // What type of profiles usually in custom profiles?? Custom production profiles? } /*ALCODEEND*/} diff --git a/_alp/Classes/Class.CustomProfile_data.java b/_alp/Classes/Class.CustomProfile_data.java index f3d17130..7f4d9eaf 100644 --- a/_alp/Classes/Class.CustomProfile_data.java +++ b/_alp/Classes/Class.CustomProfile_data.java @@ -9,6 +9,7 @@ public class CustomProfile_data { String customProfileID; List argumentsList; List valuesList; + OL_ProfileUnits profileUnits; public double[] getArgumentsArray() { return ListUtil.doubleListToArray(argumentsList); From 8a39e55c38f56e570df4afcc863cf8a7cf34aac2 Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Tue, 3 Feb 2026 10:03:30 +0100 Subject: [PATCH 6/8] Rephrased runtime error :) --- _alp/Agents/Zero_Loader/Code/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_alp/Agents/Zero_Loader/Code/Functions.java b/_alp/Agents/Zero_Loader/Code/Functions.java index 04208b60..808ffd00 100644 --- a/_alp/Agents/Zero_Loader/Code/Functions.java +++ b/_alp/Agents/Zero_Loader/Code/Functions.java @@ -3117,7 +3117,7 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl if (simTimeStep_h < dataTimeStep_h) { //Interpolate data to timeStep_h = 0.25 //traceln("***** profilePointer using tableFunction to interpolate hourly data into quarter-hourly data ********"); if ((dataTimeStep_h/simTimeStep_h)%1.0 != 0.0) { - throw new RuntimeException("dataTimeStep_h and modelTimeStep are not integer multiples! Unsupported dataformat!"); + throw new RuntimeException("dataTimeStep_h is not an integer multiple of modelTimeStep! Unsupported dataformat!"); } TableFunction tableFunction = new TableFunction(arguments, values, TableFunction.InterpolationType.INTERPOLATION_LINEAR, 2, TableFunction.OutOfRangeAction.OUTOFRANGE_REPEAT, 0.0); a_profile = new double[values.length*(int)(dataTimeStep_h/simTimeStep_h)]; From 360a69f926768dbcd09fe3a16e995114572b5282 Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Tue, 3 Feb 2026 10:11:50 +0100 Subject: [PATCH 7/8] Added annotation to Settings lombok class to make fields private. --- _alp/Classes/Class.Settings.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_alp/Classes/Class.Settings.java b/_alp/Classes/Class.Settings.java index e4d3cb21..03fff980 100644 --- a/_alp/Classes/Class.Settings.java +++ b/_alp/Classes/Class.Settings.java @@ -1,6 +1,9 @@ import lombok.Builder; import lombok.Data; import lombok.experimental.Accessors; +import lombok.AccessLevel; +import lombok.experimental.FieldDefaults; + /** @@ -10,6 +13,7 @@ @Data @Builder(toBuilder = true) @Accessors(fluent = true) +@FieldDefaults(level = AccessLevel.PRIVATE) public class Settings { //Simulation settings (Time) From 3f44d32af0d31755784b334339562394c2af4ece Mon Sep 17 00:00:00 2001 From: GillisHommen Date: Tue, 3 Feb 2026 10:19:49 +0100 Subject: [PATCH 8/8] Update Class.Settings.java --- _alp/Classes/Class.Settings.java | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/_alp/Classes/Class.Settings.java b/_alp/Classes/Class.Settings.java index 03fff980..bd3a5f36 100644 --- a/_alp/Classes/Class.Settings.java +++ b/_alp/Classes/Class.Settings.java @@ -1,29 +1,22 @@ -import lombok.Builder; -import lombok.Data; -import lombok.experimental.Accessors; -import lombok.AccessLevel; -import lombok.experimental.FieldDefaults; - - /** * Settings */ -@Data -@Builder(toBuilder = true) -@Accessors(fluent = true) -@FieldDefaults(level = AccessLevel.PRIVATE) +@lombok.Builder +@lombok.Value +@lombok.experimental.Accessors(fluent = true) +//@FieldDefaults(level = AccessLevel.PRIVATE) public class Settings { //Simulation settings (Time) - @Builder.Default + @lombok.Builder.Default double timeStep_h = 0.25; //Length of the simulation timestep in Hr - @Builder.Default + @lombok.Builder.Default int summerWeekNumber = 18; //Week number of the year where data will be stored for to display a 'default' summerweek - @Builder.Default + @lombok.Builder.Default int winterWeekNumber = 49; //Week number of the year where data will be stored for to display a 'default' winterweek - @Builder.Default + @lombok.Builder.Default double simDuration_h = 8760; // (Rapid sim (and Live sim before loop) duration in hours since the start time h.