From 7eece567a431c1c2d8155a3b4f37e453b4497219 Mon Sep 17 00:00:00 2001 From: Ate Hempenius Date: Fri, 9 Jan 2026 18:19:13 +0100 Subject: [PATCH 1/2] charger_loadin_and_interface_unification_+_address_cleanup --- Zero_engine.alpx | 1 - _alp/Agents/EnergyModel/EmbeddedObjects.xml | 45 ++----- .../AOC.GCDistrictHeating.xml | 5 +- .../AOC.GCEnergyConversion.xml | 5 +- .../AOC.GCEnergyProduction.xml | 5 +- .../GCGridBattery/AOC.GCGridBattery.xml | 5 +- _alp/Agents/GCHouse/AOC.GCHouse.xml | 5 +- _alp/Agents/GCIndustry/AOC.GCIndustry.xml | 5 +- .../GCNeighborhood/AOC.GCNeighborhood.xml | 5 +- .../GCPublicCharger/AOC.GCPublicCharger.xml | 5 +- _alp/Agents/GCUtility/AOC.GCUtility.xml | 5 +- .../Agents/GridConnection/Code/Functions.java | 2 +- _alp/Agents/GridConnection/Variables.xml | 29 +---- _alp/Classes/Class.J_Address.java | 119 +++++++++++++----- 14 files changed, 108 insertions(+), 133 deletions(-) diff --git a/Zero_engine.alpx b/Zero_engine.alpx index 52b47f00..827943f0 100644 --- a/Zero_engine.alpx +++ b/Zero_engine.alpx @@ -1125,7 +1125,6 @@ 1752681631114 - 1752677832758 1752681639768 diff --git a/_alp/Agents/EnergyModel/EmbeddedObjects.xml b/_alp/Agents/EnergyModel/EmbeddedObjects.xml index 589a0797..2bb5b532 100644 --- a/_alp/Agents/EnergyModel/EmbeddedObjects.xml +++ b/_alp/Agents/EnergyModel/EmbeddedObjects.xml @@ -206,7 +206,7 @@ - + @@ -223,9 +223,6 @@ - - - true @@ -967,7 +964,7 @@ - + @@ -1011,9 +1008,6 @@ - - - @@ -1153,7 +1147,7 @@ - + @@ -1173,9 +1167,6 @@ - - - true @@ -1291,7 +1282,7 @@ - + @@ -1311,9 +1302,6 @@ - - - true @@ -1429,7 +1417,7 @@ - + @@ -1506,9 +1494,6 @@ - - - true @@ -1624,7 +1609,7 @@ - + @@ -1641,9 +1626,6 @@ - - - true @@ -1759,7 +1741,7 @@ - + @@ -1779,9 +1761,6 @@ - - - true @@ -2236,7 +2215,7 @@ - + @@ -2286,9 +2265,6 @@ - - - true @@ -2405,7 +2381,7 @@ - + @@ -2458,9 +2434,6 @@ - - - true diff --git a/_alp/Agents/GCDistrictHeating/AOC.GCDistrictHeating.xml b/_alp/Agents/GCDistrictHeating/AOC.GCDistrictHeating.xml index 1e710fa8..a9a5f172 100644 --- a/_alp/Agents/GCDistrictHeating/AOC.GCDistrictHeating.xml +++ b/_alp/Agents/GCDistrictHeating/AOC.GCDistrictHeating.xml @@ -67,7 +67,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GCEnergyConversion/AOC.GCEnergyConversion.xml b/_alp/Agents/GCEnergyConversion/AOC.GCEnergyConversion.xml index c8bb354a..872ecc2f 100644 --- a/_alp/Agents/GCEnergyConversion/AOC.GCEnergyConversion.xml +++ b/_alp/Agents/GCEnergyConversion/AOC.GCEnergyConversion.xml @@ -68,7 +68,7 @@ - + @@ -85,9 +85,6 @@ - - - false diff --git a/_alp/Agents/GCEnergyProduction/AOC.GCEnergyProduction.xml b/_alp/Agents/GCEnergyProduction/AOC.GCEnergyProduction.xml index 544fbdfb..826b149f 100644 --- a/_alp/Agents/GCEnergyProduction/AOC.GCEnergyProduction.xml +++ b/_alp/Agents/GCEnergyProduction/AOC.GCEnergyProduction.xml @@ -67,7 +67,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GCGridBattery/AOC.GCGridBattery.xml b/_alp/Agents/GCGridBattery/AOC.GCGridBattery.xml index 43f36c37..d6f2f45d 100644 --- a/_alp/Agents/GCGridBattery/AOC.GCGridBattery.xml +++ b/_alp/Agents/GCGridBattery/AOC.GCGridBattery.xml @@ -67,7 +67,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GCHouse/AOC.GCHouse.xml b/_alp/Agents/GCHouse/AOC.GCHouse.xml index a46ac2da..ed81c7d7 100644 --- a/_alp/Agents/GCHouse/AOC.GCHouse.xml +++ b/_alp/Agents/GCHouse/AOC.GCHouse.xml @@ -70,7 +70,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GCIndustry/AOC.GCIndustry.xml b/_alp/Agents/GCIndustry/AOC.GCIndustry.xml index 7deb1fb3..67649c00 100644 --- a/_alp/Agents/GCIndustry/AOC.GCIndustry.xml +++ b/_alp/Agents/GCIndustry/AOC.GCIndustry.xml @@ -68,7 +68,7 @@ - + @@ -85,9 +85,6 @@ - - - false diff --git a/_alp/Agents/GCNeighborhood/AOC.GCNeighborhood.xml b/_alp/Agents/GCNeighborhood/AOC.GCNeighborhood.xml index caad126c..63a7e821 100644 --- a/_alp/Agents/GCNeighborhood/AOC.GCNeighborhood.xml +++ b/_alp/Agents/GCNeighborhood/AOC.GCNeighborhood.xml @@ -67,7 +67,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GCPublicCharger/AOC.GCPublicCharger.xml b/_alp/Agents/GCPublicCharger/AOC.GCPublicCharger.xml index e2f01783..03d06c37 100644 --- a/_alp/Agents/GCPublicCharger/AOC.GCPublicCharger.xml +++ b/_alp/Agents/GCPublicCharger/AOC.GCPublicCharger.xml @@ -67,7 +67,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GCUtility/AOC.GCUtility.xml b/_alp/Agents/GCUtility/AOC.GCUtility.xml index 7b9d9474..edd036c3 100644 --- a/_alp/Agents/GCUtility/AOC.GCUtility.xml +++ b/_alp/Agents/GCUtility/AOC.GCUtility.xml @@ -67,7 +67,7 @@ - + @@ -84,9 +84,6 @@ - - - false diff --git a/_alp/Agents/GridConnection/Code/Functions.java b/_alp/Agents/GridConnection/Code/Functions.java index 2c628392..0a91a5f1 100644 --- a/_alp/Agents/GridConnection/Code/Functions.java +++ b/_alp/Agents/GridConnection/Code/Functions.java @@ -430,7 +430,7 @@ else if (productionAsset.energyAssetType == OL_EnergyAssetType.PHOTOTHERMAL){ f_connectToParents(); if ( p_parentNodeElectric == null ) { - traceln("GC: %s with id %s and name %s", this, p_gridConnectionID, p_name); + traceln("GC: %s with id %s", this, p_gridConnectionID); traceln("GN id %s", p_parentNodeElectricID); throw new RuntimeException("Exception: GridConnection not connected to GridNodeElectric!"); } diff --git a/_alp/Agents/GridConnection/Variables.xml b/_alp/Agents/GridConnection/Variables.xml index 016e84a0..01eafe85 100644 --- a/_alp/Agents/GridConnection/Variables.xml +++ b/_alp/Agents/GridConnection/Variables.xml @@ -1113,7 +1113,8 @@ 1722429053561 - + + true 50 80 - - 1757330831065 - - true - 50 - 100 - - false - true - true - - - NONE - false - - 1757330831063 - TEXT_BOX - 0 - 100 - NO_DELIMETER - - - 1659962626903 diff --git a/_alp/Classes/Class.J_Address.java b/_alp/Classes/Class.J_Address.java index 18227f55..97b189b2 100644 --- a/_alp/Classes/Class.J_Address.java +++ b/_alp/Classes/Class.J_Address.java @@ -15,10 +15,10 @@ ) @JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class, property = "@id") -public class J_Address implements Serializable { +public class J_Address{ private String streetName; - private int houseNumber; + private Integer houseNumber; private String houseLetter; private String houseAddition; private String postalcode; @@ -30,6 +30,16 @@ public class J_Address implements Serializable { public J_Address() { } + public J_Address(String streetName, Integer houseNumber, String houseLetter, String houseAddition, String postalcode, String city) { + setStreetName(streetName); + setHouseNumber(houseNumber); + setHouseLetter(houseLetter); + setHouseAddition(houseAddition); + setPostalcode(postalcode); + setCity(city); + } + + //Get formated address public String getAddress() { StringBuilder sb = new StringBuilder(); @@ -40,16 +50,18 @@ public String getAddress() { sb.append("Onbekend adres"); return sb.toString(); } - sb.append(" "); - sb.append(this.houseNumber); - if ( this.houseLetter != null ) { + if(this.houseNumber != null) { sb.append(" "); - sb.append(this.houseLetter); - } - if ( this.houseAddition != null ) { - sb.append(" "); - sb.append(this.houseAddition); - } + sb.append(this.houseNumber); + if ( this.houseLetter != null ) { + sb.append(" "); + sb.append(this.houseLetter); + } + if ( this.houseAddition != null ) { + sb.append(" "); + sb.append(this.houseAddition); + } + } if ( this.postalcode != null || this.city != null) { sb.append(","); } @@ -66,54 +78,97 @@ public String getAddress() { } + //Setters public void setStreetName( String streetName ) { - this.streetName = streetName; + if (isNotEmptyString(streetName)) { + this.streetName = getFormattedName(streetName); + } + else { + this.streetName = null; + } } - public void setHouseNumber( int houseNumber ) { - this.houseNumber = houseNumber; + public void setHouseNumber( Integer houseNumber ) { + this.houseNumber = houseNumber; } public void setHouseLetter( String houseLetter ) { - this.houseLetter = houseLetter; + if(isNotEmptyString(houseLetter)) { + this.houseLetter = houseLetter; + } + else { + this.houseLetter = null; + } } public void setHouseAddition( String houseAddition ) { - this.houseAddition = houseAddition; + if(isNotEmptyString(houseAddition)) { + this.houseAddition = houseAddition; + } + else { + this.houseAddition = null; + } } public void setPostalcode( String postalcode ) { - this.postalcode = postalcode; + if(isNotEmptyString(postalcode)) { + this.postalcode = postalcode.toUpperCase().replaceAll("\\s",""); + } + else { + this.postalcode = null; + } } public void setCity( String city ) { - this.city = city; + if(isNotEmptyString(city)) { + this.city = getFormattedName(city); + } + else { + this.city = null; + } } + + //Getters public String getStreetName() { return this.streetName; } - public int getHouseNumber() { - return this.houseNumber; + public Integer getHouseNumber() { + return this.houseNumber; } public String getHouseLetter() { - return this.houseLetter; + return this.houseLetter; } public String getHouseAddition() { - return this.houseAddition; + return this.houseAddition; } public String getPostalcode() { - return this.postalcode; + return this.postalcode; } public String getCity() { - return this.city; + return this.city; } + + + //Support function for (Street/City) names to remove double white spaces and make every thing lower space, except the first letter of every word + private String getFormattedName(String name) { + String[] words = name.trim().toLowerCase().split("\\s+"); + StringBuilder sb = new StringBuilder(); + + for (String word : words) { + sb.append(Character.toUpperCase(word.charAt(0))) + .append(word.substring(1)) + .append(" "); + } + + return sb.toString().trim(); + } + + //Check used to see if address (String) item is filled in/usefull + private boolean isNotEmptyString(String str) { + // Return true if str is not null, empty and doesnt only contain spaces + return str != null && !str.trim().isEmpty(); + } + + @Override public String toString() { return "J_Address(" + getAddress() + ")"; } - - - /** - * This number is here for model snapshot storing purpose
- * It needs to be changed when this class gets changed - */ - private static final long serialVersionUID = 1L; - } \ No newline at end of file From d44dc81cb3d6f10eb82c39b18c1c3144674830ee Mon Sep 17 00:00:00 2001 From: Ate Hempenius Date: Mon, 12 Jan 2026 14:02:25 +0100 Subject: [PATCH 2/2] Update EmbeddedObjects.xml --- _alp/Agents/EnergyModel/EmbeddedObjects.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/_alp/Agents/EnergyModel/EmbeddedObjects.xml b/_alp/Agents/EnergyModel/EmbeddedObjects.xml index 2bb5b532..e3879f08 100644 --- a/_alp/Agents/EnergyModel/EmbeddedObjects.xml +++ b/_alp/Agents/EnergyModel/EmbeddedObjects.xml @@ -987,9 +987,6 @@ - - - @@ -1476,9 +1473,6 @@ - - -