diff --git a/_alp/Agents/UI_company/Code/Functions.java b/_alp/Agents/UI_company/Code/Functions.java
index ec9cda2a..98e65d3e 100644
--- a/_alp/Agents/UI_company/Code/Functions.java
+++ b/_alp/Agents/UI_company/Code/Functions.java
@@ -464,7 +464,7 @@ else if (batteryAsset == null) {
double f_setPVSystem(GridConnection GC,double v_rooftopPV_kWp)
{/*ALCODESTART::1713954180112*/
-if (GC.v_hasPV){
+if (GC.v_liveAssetsMetaData.hasPV){
J_EAProduction pvAsset = findFirst(GC.c_productionAssets, p -> p.energyAssetType == OL_EnergyAssetType.PHOTOVOLTAIC );
if (v_rooftopPV_kWp == 0) {
pvAsset.removeEnergyAsset();;
@@ -1564,7 +1564,7 @@ else if(setAmountOfVehicles < local_HydrogenV_nb){ // Slider has decreased the a
double yearlyProductionHydrogen_kWh = 0;
double timestep_h = zero_Interface.energyModel.p_timeStep_h;
double outputTemperature_degC = 0;
-parentGC.v_hasPV = true;
+parentGC.v_liveAssetsMetaData.hasPV = true;
J_EAProduction production_asset = new J_EAProduction(parentGC, asset_type, asset_name, capacityElectric_kW , capacityHeat_kW, yearlyProductionMethane_kWh, yearlyProductionHydrogen_kWh, timestep_h, outputTemperature_degC, zero_Interface.energyModel.pp_PVProduction35DegSouth_fr);
@@ -1669,7 +1669,7 @@ else if(setAmountOfVehicles < local_HydrogenV_nb){ // Slider has decreased the a
//Find the current PV capacity
int PVCapacityCurrent = 0;
-if (c_ownedGridConnections.get(v_currentSelectedGCnr).v_hasPV){
+if (c_ownedGridConnections.get(v_currentSelectedGCnr).v_liveAssetsMetaData.hasPV){
J_EAProduction pvAsset = findFirst(c_ownedGridConnections.get(v_currentSelectedGCnr).c_productionAssets, p -> p.energyAssetType == OL_EnergyAssetType.PHOTOVOLTAIC );
PVCapacityCurrent = roundToInt(pvAsset.getCapacityElectric_kW());
}
diff --git a/_alp/Agents/Zero_Interface/AOC.Zero_Interface.xml b/_alp/Agents/Zero_Interface/AOC.Zero_Interface.xml
index 62f6c555..23b80c30 100644
--- a/_alp/Agents/Zero_Interface/AOC.Zero_Interface.xml
+++ b/_alp/Agents/Zero_Interface/AOC.Zero_Interface.xml
@@ -19,6 +19,7 @@ import java.util.Dictionary.*;
import java.util.Hashtable.*;
import java.util.*;
import java.util.stream.Collectors;
+import java.lang.Object;
import java.io.*;
import java.io.File;
@@ -40,7 +41,8 @@ import zero_engine.OL_EnergyCarriers;
import com.querydsl.core.types.dsl.TimeExpression;
import zero_engine.J_EAStorageElectric;
import zero_engine.J_EAConsumption;
-import digital_twin_results.OL_ChartTypes;]]>
+import digital_twin_results.OL_ChartTypes;
+import kotlin.Triple;]]>
false
1658477103138
diff --git a/_alp/Agents/Zero_Interface/Code/Functions.java b/_alp/Agents/Zero_Interface/Code/Functions.java
index aae84df7..36331f9e 100644
--- a/_alp/Agents/Zero_Interface/Code/Functions.java
+++ b/_alp/Agents/Zero_Interface/Code/Functions.java
@@ -548,10 +548,14 @@ else if (v_previousClickedObjectType == OL_GISObjectType.BUILDING ||
v_connectionOwnerIndexNr = 0;
//Get the ghost vehicles for the transport slider tab
-uI_Tabs.pop_tabMobility.get(0).f_calculateNumberOfGhostVehicles();
-
+Triple triple = uI_Tabs.pop_tabMobility.get(0).f_calculateNumberOfGhostVehicles( new ArrayList(energyModel.UtilityConnections.findAll( x -> true)) );
+uI_Tabs.pop_tabMobility.get(0).v_totalNumberOfGhostVehicle_Cars = triple.getFirst();
+uI_Tabs.pop_tabMobility.get(0).v_totalNumberOfGhostVehicle_Vans = triple.getSecond();
+uI_Tabs.pop_tabMobility.get(0).v_totalNumberOfGhostVehicle_Trucks = triple.getThird();
//Get the ghost heating systems
-uI_Tabs.pop_tabHeating.get(0).f_calculateNumberOfGhostHeatingSystems();
+Pair pair = uI_Tabs.pop_tabHeating.get(0).f_calculateNumberOfGhostHeatingSystems( energyModel.UtilityConnections.findAll( x -> true) );
+uI_Tabs.pop_tabHeating.get(0).v_totalNumberOfGhostHeatingSystems_ElectricHeatpumps = pair.getFirst();
+uI_Tabs.pop_tabHeating.get(0).v_totalNumberOfGhostHeatingSystems_HybridHeatpumps = pair.getSecond();
/*ALCODEEND*/}
@@ -615,34 +619,27 @@ else if (v_previousClickedObjectType == OL_GISObjectType.BUILDING ||
double f_initialPVSystemsOrder()
{/*ALCODESTART::1714130288661*/
-// First we make a copy of all the Uitility GridConnections
-List GCs = new ArrayList<>(energyModel.f_getGridConnections());
-List GCs_detailedCompanies = new ArrayList<>(energyModel.f_getGridConnections());
-if( p_selectedProjectType == OL_ProjectType.RESIDENTIAL){
- GCs = GCs.stream().filter(gc -> gc instanceof GCHouse).collect(Collectors.toList());
-}
-else {
- GCs_detailedCompanies = GCs.stream().filter(gc -> gc instanceof GCUtility && gc.p_owner.p_detailedCompany).collect(Collectors.toList());
- GCs = GCs.stream().filter(gc -> gc instanceof GCUtility && !gc.p_owner.p_detailedCompany).collect(Collectors.toList());
-}
-// Find all the GCs with PV at the start of the simulation
-ArrayList GCsWithPV = GCs.stream().filter(gc -> gc.v_hasPV).collect(Collectors.toCollection(ArrayList::new));
-ArrayList otherGCs = GCs.stream().filter(gc -> !gc.v_hasPV).collect(Collectors.toCollection(ArrayList::new));
-//Collections.shuffle(otherGCs);
-ArrayList detailedCompanyGCsWithPV = GCs_detailedCompanies.stream().filter(gc -> gc.v_hasPV).collect(Collectors.toCollection(ArrayList::new));
-ArrayList datailedCompanyGCsnoPV = GCs_detailedCompanies.stream().filter(gc -> !gc.v_hasPV).collect(Collectors.toCollection(ArrayList::new));
+List houses = new ArrayList(energyModel.Houses.findAll( x -> true));
+List housesWithoutPV = houses.stream().filter( gc -> !gc.v_liveAssetsMetaData.hasPV ).collect(Collectors.toList());
+List housesWithPV = new ArrayList<>(houses);
+housesWithPV.removeAll(housesWithoutPV);
-// We make sure that the GCs with PV at the start of the simulation are the last in the list
+c_orderedPVSystemsHouses = new ArrayList<>(housesWithoutPV);
+c_orderedPVSystemsHouses.addAll(housesWithPV);
-//traceln("amount of GCs with PV at start: " + GCsWithPV.size());
-//traceln("amount of other GCs at start: " + otherGCs.size());
-if(c_companyUIs.size() == 0){
- otherGCs.addAll(GCsWithPV);
-}
+List companies = new ArrayList(energyModel.UtilityConnections.findAll( x -> true));
+List companiesWithoutPV = companies.stream().filter( gc -> !gc.v_liveAssetsMetaData.hasPV ).collect(Collectors.toList());
+List companiesWithPV = companies.stream().filter( gc -> gc.v_liveAssetsMetaData.hasPV ).collect(Collectors.toList());
+List detailedCompaniesWithPV = companiesWithPV.stream().filter( gc -> gc.p_owner != null && gc.p_owner.p_detailedCompany ).collect(Collectors.toList());
+List genericCompaniesWithPV = new ArrayList<>(companiesWithPV);
+genericCompaniesWithPV.removeAll(detailedCompaniesWithPV);
+
+c_orderedPVSystemsCompanies = new ArrayList<>(companiesWithoutPV);
+c_orderedPVSystemsCompanies.addAll(genericCompaniesWithPV);
+c_orderedPVSystemsCompanies.addAll(detailedCompaniesWithPV);
+
-c_orderedPVSystems = otherGCs;
-c_orderedPVSystems.addAll(datailedCompanyGCsnoPV);
/*ALCODEEND*/}
double f_initialElectricVehiclesOrder()
@@ -667,27 +664,27 @@ else if (v_previousClickedObjectType == OL_GISObjectType.BUILDING ||
double f_initialHeatingSystemsOrder()
{/*ALCODESTART::1714131269202*/
-// First we make a copy of all the GridConnections
-List companyList = new ArrayList<>(energyModel.f_getGridConnections());
-companyList = companyList.stream().filter(gc -> gc instanceof GCUtility && gc.p_primaryHeatingAsset != null).collect(Collectors.toList());
+List houses = new ArrayList(energyModel.Houses.findAll( x -> true));
+List housesWithoutHP = houses.stream().filter( gc -> gc.p_heatingType != OL_GridConnectionHeatingType.HEATPUMP_AIR ).collect(Collectors.toList());
+List housesWithHP = new ArrayList<>(houses);
+housesWithHP.removeAll(housesWithoutHP);
-// Find all the GCs with Heatpumps at the start of the simulation
-ArrayList GCsWithHP = companyList.stream().filter(gc -> gc.p_primaryHeatingAsset instanceof J_EAConversionHeatPump).collect(Collectors.toCollection(ArrayList::new));
-ArrayList otherGCs = companyList.stream().filter(gc -> !(gc.p_primaryHeatingAsset instanceof J_EAConversionHeatPump)).collect(Collectors.toCollection(ArrayList::new));
-// We make sure that the GCs with Heatpumps at the start of the simulation are the last in the list (if there is no companyUI)
-if(c_companyUIs.size() == 0){
- otherGCs.addAll(GCsWithHP);
-}
-c_orderedHeatingSystemsCompanies = otherGCs;
+c_orderedHeatingSystemsHouses = new ArrayList<>(housesWithoutHP);
+c_orderedHeatingSystemsHouses.addAll(housesWithHP);
+
+
+List companies = new ArrayList(energyModel.UtilityConnections.findAll( x -> true));
+List companiesWithoutHP = companies.stream().filter( gc -> gc.p_heatingType != OL_GridConnectionHeatingType.HEATPUMP_AIR ).collect(Collectors.toList());
+List companiesWithHP = companies.stream().filter( gc -> gc.p_heatingType == OL_GridConnectionHeatingType.HEATPUMP_AIR ).collect(Collectors.toList());
+List detailedCompaniesWithHP = companiesWithHP.stream().filter( gc -> gc.p_owner != null && gc.p_owner.p_detailedCompany ).collect(Collectors.toList());
+List genericCompaniesWithHP = new ArrayList<>(companiesWithHP);
+genericCompaniesWithHP.removeAll(detailedCompaniesWithHP);
+
+c_orderedHeatingSystemsCompanies = new ArrayList<>(companiesWithoutHP);
+c_orderedHeatingSystemsCompanies.addAll(genericCompaniesWithHP);
+c_orderedHeatingSystemsCompanies.addAll(detailedCompaniesWithHP);
-// Doe same for houses
-List houseList = new ArrayList<>(energyModel.f_getGridConnections());
-houseList = houseList.stream().filter(gc -> gc instanceof GCHouse).collect(Collectors.toList());
-ArrayList housesWithHP = houseList.stream().filter(gc -> gc.p_primaryHeatingAsset instanceof J_EAConversionHeatPump).collect(Collectors.toCollection(ArrayList::new));
-ArrayList otherHouses = houseList.stream().filter(gc -> !(gc.p_primaryHeatingAsset instanceof J_EAConversionHeatPump)).collect(Collectors.toCollection(ArrayList::new));
-otherHouses.addAll(housesWithHP);
-c_orderedHeatingSystemsHouses = otherHouses;
/*ALCODEEND*/}
double f_initalAssetOrdering()
@@ -726,7 +723,7 @@ else if (v_previousClickedObjectType == OL_GISObjectType.BUILDING ||
*/
if (gis_area.c_containedGridConnections.size() > 0) {
- if (gis_area.c_containedGridConnections.get(0).v_hasPV) {
+ if (gis_area.c_containedGridConnections.get(0).v_liveAssetsMetaData.hasPV) {
if (gis_area.c_containedGridConnections.get(0).c_productionAssets.get(0).getCapacityElectric_kW() < 100){
gis_area.f_style(rect_smallProduction.getFillColor(), null, null, null);
}
@@ -846,7 +843,7 @@ public void write(int b) {
double f_setColorsBasedOnProductionHouseholds(GIS_Object gis_area)
{/*ALCODESTART::1718265697364*/
if (gis_area.c_containedGridConnections.size() > 0) {
- if (gis_area.c_containedGridConnections.get(0).v_hasPV) {
+ if (gis_area.c_containedGridConnections.get(0).v_liveAssetsMetaData.hasPV) {
if (gis_area.c_containedGridConnections.get(0).c_productionAssets.get(0).getCapacityElectric_kW() < 5){
gis_area.f_style( rect_householdSmallProduction.getFillColor(), null, null, null );
}
@@ -865,15 +862,8 @@ public void write(int b) {
{/*ALCODESTART::1718288402102*/
// ATTENTION: If you have custom tabs it may be neccesary to override this function and add updates to your custom sliders!
-if(c_companyUIs.size()>0){//Update ghost vehicles and heating systems present if there are companyUIs
- uI_Tabs.pop_tabHeating.get(0).f_calculateNumberOfGhostHeatingSystems();
- uI_Tabs.pop_tabMobility.get(0).f_calculateNumberOfGhostVehicles();
-}
-
-
-
// PV SYSTEMS:
-double PVsystems = count(energyModel.UtilityConnections, x->x.v_hasPV == true && x.v_isActive);
+double PVsystems = count(energyModel.UtilityConnections, x->x.v_liveAssetsMetaData.hasPV == true && x.v_isActive);
int PV_pct = roundToInt(100 * PVsystems / count(energyModel.UtilityConnections, x->x.v_isActive));
uI_Tabs.pop_tabElectricity.get(0).getSliderRooftopPVCompanies_pct().setValue(PV_pct, false);
@@ -1687,7 +1677,7 @@ else if(c_selectedFilterOptions.contains(selectedFilter_OL)){ // Remove filter
double f_filterHasPV(ArrayList toBeFilteredGC)
{/*ALCODESTART::1734448690487*/
-c_selectedGridConnections = new ArrayList<>(findAll(toBeFilteredGC, GC -> GC.v_hasPV));
+c_selectedGridConnections = new ArrayList<>(findAll(toBeFilteredGC, GC -> GC.v_liveAssetsMetaData.hasPV));
/*ALCODEEND*/}
diff --git a/_alp/Agents/Zero_Interface/Variables.xml b/_alp/Agents/Zero_Interface/Variables.xml
index 6c12cb15..2b24313a 100644
--- a/_alp/Agents/Zero_Interface/Variables.xml
+++ b/_alp/Agents/Zero_Interface/Variables.xml
@@ -2411,7 +2411,7 @@
1715178022675
68
- -550
+ -535