From 8e958f8724ec27cf52ab91dfb93a030acb96b26d Mon Sep 17 00:00:00 2001 From: GillisHommen <98752265+GillisHommen@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:28:55 +0200 Subject: [PATCH 1/7] Working (de-)serialisation for Local4Local --- _alp/Agents/EnergyCoop/AOC.EnergyCoop.xml | 2 +- _alp/Agents/EnergyCoop/Code/Functions.java | 9 +++++++++ _alp/Agents/EnergyCoop/Code/Functions.xml | 16 ++++++++++++++++ _alp/Agents/EnergyModel/Variables.xml | 2 +- _alp/Agents/GridConnection/Code/Functions.java | 9 +++++++++ _alp/Agents/GridConnection/Code/Functions.xml | 16 ++++++++++++++++ _alp/Classes/Class.J_ProfilePointer.java | 6 +++++- 7 files changed, 57 insertions(+), 3 deletions(-) diff --git a/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml b/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml index 60936204..f77b922e 100644 --- a/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml +++ b/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml @@ -42,7 +42,7 @@ v_liveConnectionMetaData = new J_ConnectionMetaData(this); v_liveAssetsMetaData = new J_AssetsMetaData(this); v_liveData.connectionMetaData = v_liveConnectionMetaData; v_liveData.assetsMetaData = v_liveAssetsMetaData; -]]> +energyModel.c_actors.add(this);]]> false 1660731375014 diff --git a/_alp/Agents/EnergyCoop/Code/Functions.java b/_alp/Agents/EnergyCoop/Code/Functions.java index e7073038..1d587f62 100644 --- a/_alp/Agents/EnergyCoop/Code/Functions.java +++ b/_alp/Agents/EnergyCoop/Code/Functions.java @@ -2035,3 +2035,12 @@ HashSet f_getAllChildCustomerGridConnections_recursion(HashSettrue + + VOID + double + 1753348770752 + + 760 + 80 + + false + true + true + + diff --git a/_alp/Agents/EnergyModel/Variables.xml b/_alp/Agents/EnergyModel/Variables.xml index bc5d8b08..afb6b036 100644 --- a/_alp/Agents/EnergyModel/Variables.xml +++ b/_alp/Agents/EnergyModel/Variables.xml @@ -2563,7 +2563,7 @@ false true true - + ArrayList J_EA String diff --git a/_alp/Agents/GridConnection/Code/Functions.java b/_alp/Agents/GridConnection/Code/Functions.java index a40bff32..7a0b8f76 100644 --- a/_alp/Agents/GridConnection/Code/Functions.java +++ b/_alp/Agents/GridConnection/Code/Functions.java @@ -1890,3 +1890,12 @@ else if (flowsMap.get(EC) > 0){ } /*ALCODEEND*/} +double f_startAfterDeserialisation() +{/*ALCODESTART::1753348699140*/ +v_liveData = new J_LiveData(this); +//v_liveConnectionMetaData = new J_ConnectionMetaData(this); +//v_liveAssetsMetaData = new J_AssetsMetaData(this); +v_liveData.connectionMetaData = v_liveConnectionMetaData; +v_liveData.assetsMetaData = v_liveAssetsMetaData; +/*ALCODEEND*/} + diff --git a/_alp/Agents/GridConnection/Code/Functions.xml b/_alp/Agents/GridConnection/Code/Functions.xml index fd4a13e4..71944367 100644 --- a/_alp/Agents/GridConnection/Code/Functions.xml +++ b/_alp/Agents/GridConnection/Code/Functions.xml @@ -637,4 +637,20 @@ true + + VOID + double + 1753348699140 + + 1030 + 50 + + false + true + true + + diff --git a/_alp/Classes/Class.J_ProfilePointer.java b/_alp/Classes/Class.J_ProfilePointer.java index 7c8b0d78..60e13e64 100644 --- a/_alp/Classes/Class.J_ProfilePointer.java +++ b/_alp/Classes/Class.J_ProfilePointer.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators; @JsonAutoDetect( - fieldVisibility = Visibility.ANY, // ✅ only public fields are serialized + fieldVisibility = Visibility.PROTECTED_AND_PUBLIC, // ✅ only public fields are serialized getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, @@ -48,6 +48,10 @@ public double[] getAllValues() { return this.tableFunction.getValues(); } + public void setTableFunction(TableFunction tf) { + this.tableFunction = tf; + } + @Override public String toString() { return "profile: " + this.name + " current value: " + this.currentValue; From a822c00f74803b1fed33bb78beca59bea770a60f Mon Sep 17 00:00:00 2001 From: GillisHommen <98752265+GillisHommen@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:29:55 +0200 Subject: [PATCH 2/7] Now with all relevant files... --- _alp/Agents/EnergyCoop/AOC.EnergyCoop.xml | 6 +- _alp/Agents/EnergyCoop/Variables.xml | 6 -- _alp/Agents/EnergyModel/AOC.EnergyModel.xml | 6 +- _alp/Agents/EnergyModel/Code/Functions.java | 4 +- _alp/Agents/EnergyModel/EmbeddedObjects.xml | 6 ++ _alp/Agents/EnergyModel/Variables.xml | 11 +--- _alp/Agents/GCHouse/AOC.GCHouse.xml | 6 ++ _alp/Agents/GCHouse/Variables.xml | 66 +++++++++++++++++-- .../GridConnection/AOC.GridConnection.xml | 5 ++ _alp/Agents/GridConnection/Variables.xml | 9 --- _alp/Classes/Class.J_EABuilding.java | 1 + 11 files changed, 94 insertions(+), 32 deletions(-) diff --git a/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml b/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml index f77b922e..da50a84f 100644 --- a/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml +++ b/_alp/Agents/EnergyCoop/AOC.EnergyCoop.xml @@ -37,7 +37,11 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; I_EnergyData - ]]> - - - @@ -1479,9 +1476,6 @@ AccessType="public" StaticVariable="false"> ]]> - - - diff --git a/_alp/Agents/EnergyModel/AOC.EnergyModel.xml b/_alp/Agents/EnergyModel/AOC.EnergyModel.xml index 79ae2d90..cfa37037 100644 --- a/_alp/Agents/EnergyModel/AOC.EnergyModel.xml +++ b/_alp/Agents/EnergyModel/AOC.EnergyModel.xml @@ -51,7 +51,11 @@ import com.querydsl.core.types.dsl.TimeExpression; //import zero_engine.J_EAConsumption; ]]> I_EnergyData - p.name.equals(assetName)); //traceln("J_EAConsumption with name %s found profile asset: %s", assetName, profilePointer); -if (profilePointer == null) { +if (profilePointer == null) { + traceln("No profilePointer with name %s found", assetName); throw new RuntimeException(String.format("Consumption or production asset without valid profile!") ); } return profilePointer; @@ -1524,6 +1525,7 @@ EnergyCoop f_addProductionEnergyCarrier(OL_EnergyCarriers EC) } } if( e instanceof J_EABuilding ) { + //traceln("v_currentSolarPowerNormalized_r: %s", v_currentSolarPowerNormalized_r); ((J_EABuilding)e).updateSolarRadiation(v_currentSolarPowerNormalized_r*1000); } } diff --git a/_alp/Agents/EnergyModel/EmbeddedObjects.xml b/_alp/Agents/EnergyModel/EmbeddedObjects.xml index c2e02fda..c35cfcf4 100644 --- a/_alp/Agents/EnergyModel/EmbeddedObjects.xml +++ b/_alp/Agents/EnergyModel/EmbeddedObjects.xml @@ -1138,6 +1138,12 @@ + + + + + + true diff --git a/_alp/Agents/EnergyModel/Variables.xml b/_alp/Agents/EnergyModel/Variables.xml index afb6b036..7dd13f0b 100644 --- a/_alp/Agents/EnergyModel/Variables.xml +++ b/_alp/Agents/EnergyModel/Variables.xml @@ -1571,9 +1571,6 @@ AccessType="public" StaticVariable="false"> ]]> - - - @@ -1593,9 +1590,6 @@ AccessType="public" StaticVariable="false"> ]]> - - - @@ -1615,9 +1609,6 @@ AccessType="public" StaticVariable="false"> ]]> - - - @@ -2763,7 +2754,7 @@ false true true - + ArrayList J_ProfilePointer String diff --git a/_alp/Agents/GCHouse/AOC.GCHouse.xml b/_alp/Agents/GCHouse/AOC.GCHouse.xml index 5834fb49..f7a7858d 100644 --- a/_alp/Agents/GCHouse/AOC.GCHouse.xml +++ b/_alp/Agents/GCHouse/AOC.GCHouse.xml @@ -105,6 +105,12 @@ + + + + + + false diff --git a/_alp/Agents/GCHouse/Variables.xml b/_alp/Agents/GCHouse/Variables.xml index 5db0700c..a17259a5 100644 --- a/_alp/Agents/GCHouse/Variables.xml +++ b/_alp/Agents/GCHouse/Variables.xml @@ -226,9 +226,10 @@ 1704447555069 - + + true 1460 - 110 + -40 1704447555071 - + + true 1460 - 90 + -20 + + 1753354062572 + + 1460 + 108 + + false + true + true + + + NONE + false + + + + + 1753354062570 + TEXT_BOX + 0 + 100 + NO_DELIMETER + + + + + 1753354182380 + + 1460 + 90 + + false + true + true + + + NONE + false + + + + + 1753354182378 + TEXT_BOX + 0 + 100 + NO_DELIMETER + + + diff --git a/_alp/Agents/GridConnection/AOC.GridConnection.xml b/_alp/Agents/GridConnection/AOC.GridConnection.xml index eb11f0dc..3b6f21a7 100644 --- a/_alp/Agents/GridConnection/AOC.GridConnection.xml +++ b/_alp/Agents/GridConnection/AOC.GridConnection.xml @@ -53,6 +53,11 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; @JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class, property = "@id")]]> I_EnergyData ]]> - - - @@ -866,9 +863,6 @@ AccessType="public" StaticVariable="false"> ]]> - - - @@ -888,9 +882,6 @@ AccessType="public" StaticVariable="false"> ]]> - - - diff --git a/_alp/Classes/Class.J_EABuilding.java b/_alp/Classes/Class.J_EABuilding.java index 487f8fef..f6bfcbce 100644 --- a/_alp/Classes/Class.J_EABuilding.java +++ b/_alp/Classes/Class.J_EABuilding.java @@ -60,6 +60,7 @@ public J_EABuilding(Agent parentAgent, double capacityHeat_kW, double lossFactor @Override public void calculateLoss() { double heatLoss_kW = this.lossFactor_WpK * ( this.temperature_degC - this.ambientTemperature_degC ) / 1000; + //traceln("ambientTemperature_degC in J_EABuilding: %s", this.ambientTemperature_degC); //traceln("heatLoss_kW: %s", heatLoss_kW); double deltaEnergy_kWh = -heatLoss_kW * this.timestep_h; this.energyUse_kW += heatLoss_kW; From 66d2ff107311bd59b077e42b8e60d61258fb1e41 Mon Sep 17 00:00:00 2001 From: GillisHommen <98752265+GillisHommen@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:57:45 +0200 Subject: [PATCH 3/7] Further updates for serialisation of GENIUS model --- _alp/Agents/EnergyModel/Variables.xml | 20 +++++++++++++++- _alp/Agents/GCHouse/AOC.GCHouse.xml | 6 ----- _alp/Agents/GIS_Object/AOC.GIS_Object.xml | 21 ++++++++++++++++ _alp/Classes/Class.AgentMixin.java | 24 ++++++++++++++++++- _alp/Classes/Class.J_Address.java | 14 +++++++++++ .../Classes/Class.J_BatteryManagementOff.java | 4 ++++ .../Class.J_BatteryManagementPeakShaving.java | 4 ++++ ..._BatteryManagementPeakShavingForecast.java | 5 +++- .../Class.J_BatteryManagementPrice.java | 5 ++++ _alp/Classes/Class.J_EA.java | 4 ++++ 10 files changed, 98 insertions(+), 9 deletions(-) diff --git a/_alp/Agents/EnergyModel/Variables.xml b/_alp/Agents/EnergyModel/Variables.xml index 7dd13f0b..5cfec3fa 100644 --- a/_alp/Agents/EnergyModel/Variables.xml +++ b/_alp/Agents/EnergyModel/Variables.xml @@ -2736,7 +2736,7 @@ false true true - + ArrayList GridConnection String @@ -2814,4 +2814,22 @@ String + + 1753361227218 + + 240 + -110 + + false + true + true + + ArrayList + GIS_Object + String + + diff --git a/_alp/Agents/GCHouse/AOC.GCHouse.xml b/_alp/Agents/GCHouse/AOC.GCHouse.xml index f7a7858d..5834fb49 100644 --- a/_alp/Agents/GCHouse/AOC.GCHouse.xml +++ b/_alp/Agents/GCHouse/AOC.GCHouse.xml @@ -105,12 +105,6 @@ - - - - - - false diff --git a/_alp/Agents/GIS_Object/AOC.GIS_Object.xml b/_alp/Agents/GIS_Object/AOC.GIS_Object.xml index 42e32d4e..fdc3526f 100644 --- a/_alp/Agents/GIS_Object/AOC.GIS_Object.xml +++ b/_alp/Agents/GIS_Object/AOC.GIS_Object.xml @@ -4,6 +4,26 @@ 1752681631114 + false 1667726338855 @@ -101,6 +121,7 @@ 1667726338852 + true 50 -50