Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _alp/Agents/UI_company/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ else if(setAmountOfVehicles < local_HydrogenV_nb){ // Slider has decreased the a
currentHeatSavings = roundToInt((consumptionEAHEAT.getConsumptionScaling_fr() - 1)*-100);
}
else{
J_EAProfile profileEAHEAT = findFirst(c_ownedGridConnections.get(v_currentSelectedGCnr).c_profileAssets, profileAsset -> profileAsset.profileType == OL_ProfileAssetType.HEATDEMAND);
J_EAProfile profileEAHEAT = findFirst(c_ownedGridConnections.get(v_currentSelectedGCnr).c_profileAssets, profileAsset -> profileAsset.energyCarrier == OL_EnergyCarriers.HEAT);
if (profileEAHEAT != null){
currentHeatSavings = roundToInt((profileEAHEAT.getProfileScaling_fr() - 1)*-100);
}
Expand All @@ -1623,7 +1623,7 @@ else if(setAmountOfVehicles < local_HydrogenV_nb){ // Slider has decreased the a
currentElectricitySavings = roundToInt((consumptionEAELECTRIC.getConsumptionScaling_fr() - 1)*-100);
}
else{
J_EAProfile profileEAELECTRIC = findFirst(c_ownedGridConnections.get(v_currentSelectedGCnr).c_profileAssets, profileAsset -> profileAsset.profileType == OL_ProfileAssetType.ELECTRICITYBASELOAD);
J_EAProfile profileEAELECTRIC = findFirst(c_ownedGridConnections.get(v_currentSelectedGCnr).c_profileAssets, profileAsset -> profileAsset.assetFlowCategory == OL_AssetFlowCategories.fixedConsumptionElectric_kW);
if (profileEAELECTRIC != null){
currentElectricitySavings = roundToInt((profileEAELECTRIC.getProfileScaling_fr() - 1)*-100);
}
Expand Down
29 changes: 10 additions & 19 deletions _alp/Agents/Zero_Loader/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ else if(RegionCoords.startsWith("LineString")){
owner = energyModel.add_pop_connectionOwners();

owner.set_p_actorID( dataSolarfarm.owner_id());
owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
owner.set_p_connectionOwnerType( OL_ConnectionOwnerType.SOLARFARM_OP );
owner.b_dataSharingAgreed = true;
existing_actors.add(owner.p_actorID);
Expand Down Expand Up @@ -357,7 +356,6 @@ else if(RegionCoords.startsWith("LineString")){

//Owner parameters
owner.set_p_actorID( dataBattery.owner_id() );
owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
owner.set_p_connectionOwnerType( OL_ConnectionOwnerType.BATTERY_OP );
owner.b_dataSharingAgreed = true;

Expand Down Expand Up @@ -494,7 +492,6 @@ else if(RegionCoords.startsWith("LineString")){
owner = energyModel.add_pop_connectionOwners();

owner.set_p_actorID( H2Electrolyser.p_ownerID );
owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
owner.set_p_connectionOwnerType( OL_ConnectionOwnerType.ELECTROLYSER_OP );
owner.b_dataSharingAgreed = true;
}
Expand Down Expand Up @@ -568,7 +565,7 @@ else if(RegionCoords.startsWith("LineString")){
owner = energyModel.add_pop_connectionOwners();

owner.set_p_actorID( windfarm.p_ownerID );
owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
//owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
owner.set_p_connectionOwnerType( OL_ConnectionOwnerType.WINDFARM_OP );
owner.b_dataSharingAgreed = true;
}
Expand Down Expand Up @@ -712,7 +709,6 @@ else if(RegionCoords.startsWith("LineString")){
GridOperator GO = energyModel.add_pop_gridOperators();

GO.p_actorID = project_data.grid_operator();
GO.p_actorType = OL_ActorType.OPERATORGRID;
GO.p_hasCongestionPricing = project_data.hasCongestionPricing() != null ? project_data.hasCongestionPricing() : false;


Expand All @@ -722,7 +718,6 @@ else if(RegionCoords.startsWith("LineString")){
EnergyCoop EC = energyModel.add_pop_energyCoops();

EC.p_actorID = project_data.energy_coop();
EC.p_actorType = OL_ActorType.COOPENERGY;
EC.p_gridOperator = GO;
//EC.p_CoopParent = EC.p_actorID; // WAT BETEKENT COOP PARENT??
}
Expand All @@ -734,7 +729,6 @@ else if(RegionCoords.startsWith("LineString")){
EnergySupplier ES = energyModel.add_pop_energySuppliers();

ES.p_actorID = project_data.energy_supplier();
ES.p_actorType = OL_ActorType.SUPPLIERENERGY;
}


Expand Down Expand Up @@ -816,7 +810,6 @@ else if(RegionCoords.startsWith("LineString")){
ConnectionOwner COC = energyModel.add_pop_connectionOwners(); // Create Connection owner company

COC.p_actorID = genericCompany.address_id();
COC.p_actorType = OL_ActorType.CONNECTIONOWNER;
COC.p_connectionOwnerType = OL_ConnectionOwnerType.COMPANY;
COC.p_detailedCompany = false;
COC.b_dataSharingAgreed = true;
Expand Down Expand Up @@ -1081,7 +1074,7 @@ GIS_Object f_createGISObject(String name,double latitude,double longitude,String
//Create connection owner
ConnectionOwner survey_owner = energyModel.add_pop_connectionOwners();
survey_owner.p_actorID = survey.getCompanyName();
survey_owner.p_actorType = OL_ActorType.CONNECTIONOWNER;
//survey_owner.p_actorType = OL_ActorType.CONNECTIONOWNER;
survey_owner.p_connectionOwnerType = OL_ConnectionOwnerType.COMPANY;
survey_owner.p_detailedCompany = true;
survey_owner.b_dataSharingAgreed = survey.getDataSharingAgreed();
Expand Down Expand Up @@ -1591,7 +1584,7 @@ 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_ProfileAssetType.CHARGING, energyModel.p_timeStep_h);
J_EAProfile profile = new J_EAProfile(GC, OL_EnergyCarriers.ELECTRICITY, null, OL_AssetFlowCategories.evChargingPower_kW, energyModel.p_timeStep_h);
profile.energyAssetName = "charging profile";
List<Double> 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();
Expand Down Expand Up @@ -1655,7 +1648,7 @@ GISRegion f_createGISRegionChargingStation(double lat,double lon)

chargingStation.set_p_ownerID( dataChargingStation.owner_id());
owner.set_p_actorID( chargingStation.p_ownerID );
owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
//owner.set_p_actorType( OL_ActorType.CONNECTIONOWNER );
owner.set_p_connectionOwnerType( OL_ConnectionOwnerType.CHARGEPOINT_OP );
owner.b_dataSharingAgreed = true;

Expand Down Expand Up @@ -1803,7 +1796,7 @@ GISRegion f_createGISRegionChargingStation(double lat,double lon)
double f_createPreprocessedElectricityProfile_PV(GridConnection parentGC,double[] yearlyElectricityDelivery_kWh,double[] yearlyElectricityFeedin_kWh,double[] yearlyElectricityProduction_kWh,Double pvPower_kW,double[] yearlyHeatPumpElectricityConsumption_kWh)
{/*ALCODESTART::1726584205861*/
//Create the profile
J_EAProfile profile = new J_EAProfile(parentGC, OL_EnergyCarriers.ELECTRICITY, null, OL_ProfileAssetType.ELECTRICITYBASELOAD, energyModel.p_timeStep_h);
J_EAProfile profile = new J_EAProfile(parentGC, OL_EnergyCarriers.ELECTRICITY, null, OL_AssetFlowCategories.fixedConsumptionElectric_kW, energyModel.p_timeStep_h);
profile.setStartTime_h(v_simStartHour_h);
profile.energyAssetName = parentGC.p_ownerID + " custom profile";
double extraConsumption_kWh = 0;
Expand Down Expand Up @@ -1878,7 +1871,7 @@ GISRegion f_createGISRegionChargingStation(double lat,double lon)
}
profile.a_energyProfile_kWh = preProcessedDefaultConsumptionProfile;

J_EAProfile profileHeatPumpElectricityConsumption = new J_EAProfile(parentGC, OL_EnergyCarriers.ELECTRICITY, yearlyHeatPumpElectricityConsumption_kWh, OL_ProfileAssetType.HEATPUMP_ELECTRICITY_CONSUMPTION, energyModel.p_timeStep_h);
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";
}
Expand Down Expand Up @@ -3079,7 +3072,7 @@ J_ProfilePointer f_createEngineProfile(String profileID,double[] arguments,doubl
double profileTimestep_hr = project_data.gridnode_profile_timestep_hr();

//Add profile to the GC
J_EAProfile profile = new J_EAProfile(GC_GridNode_profile, OL_EnergyCarriers.ELECTRICITY, profile_data_kWh, OL_ProfileAssetType.ELECTRICITYBASELOAD, profileTimestep_hr);
J_EAProfile profile = new J_EAProfile(GC_GridNode_profile, OL_EnergyCarriers.ELECTRICITY, profile_data_kWh, OL_AssetFlowCategories.fixedConsumptionElectric_kW, profileTimestep_hr);
profile.setStartTime_h(v_simStartHour_h);
profile.energyAssetName = "GridNode " + gridnode.p_gridNodeID + " profile";

Expand Down Expand Up @@ -3328,7 +3321,6 @@ else if (GCH.p_bouwjaar < 2015) {

//Set parameters for the Actor: ConnectionOwner
COH.p_actorID = GCH.p_ownerID;
COH.p_actorType = OL_ActorType.CONNECTIONOWNER;
COH.p_connectionOwnerType = OL_ConnectionOwnerType.HOUSEHOLD;
COH.p_detailedCompany = false;
GCH.p_owner = COH;
Expand Down Expand Up @@ -3528,7 +3520,6 @@ else if (randomTrue(0.5) ){ // 25% kans op hele dag aan
ConnectionOwner COC = energyModel.add_pop_connectionOwners(); // Create Connection owner company

COC.p_actorID = "Parking space connection owner: " + dataParkingSpace.parking_id();
COC.p_actorType = OL_ActorType.CONNECTIONOWNER;
COC.p_connectionOwnerType = OL_ConnectionOwnerType.PARKINGSPACE_OP;
COC.p_detailedCompany = false;
COC.b_dataSharingAgreed = true;
Expand Down Expand Up @@ -3863,7 +3854,7 @@ else if (surveyGC.getNaturalGas().getHourlyDelivery_m3() != null && surveyGC.get
// We assume all delivery is consumption and convert m3 to kWh
ZeroMath.arrayMultiply(profile_m3, avgc_data.p_gas_kWhpm3);
// Then we create the profile asset and name it
J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.METHANE, profile_m3, OL_ProfileAssetType.METHANEDEMAND , energyModel.p_timeStep_h);
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";

if(engineGC.p_owner.p_detailedCompany){
Expand Down Expand Up @@ -4000,7 +3991,7 @@ else if ( surveyGC.getNaturalGas().getAnnualDelivery_m3() != null && surveyGC.ge
// Finally, multiply the gas profile with the total conversion factor to get the heat profile
ZeroMath.arrayMultiply(profile_m3, avgc_data.p_gas_kWhpm3 * gasToHeatEfficiency * ratioGasUsedForHeating);
// Then we create the profile asset and name it
J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.HEAT, profile_m3, OL_ProfileAssetType.HEATDEMAND , energyModel.p_timeStep_h);
J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.HEAT, profile_m3, null , energyModel.p_timeStep_h);
j_ea.energyAssetName = engineGC.p_ownerID + " custom building heat profile";

if(engineGC.p_owner.p_detailedCompany){
Expand Down Expand Up @@ -4088,7 +4079,7 @@ else if ( surveyGC.getNaturalGas().getAnnualDelivery_m3() != null && surveyGC.ge
// TODO: Fix this for LT_DISTRICTHEAT, they have a different efficiency!
ZeroMath.arrayMultiply(profile, avgc_data.p_avgEfficiencyDistrictHeatingDeliverySet_fr);
// Then we create the profile asset and name it
J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.HEAT, profile, OL_ProfileAssetType.HEATDEMAND , energyModel.p_timeStep_h);
J_EAProfile j_ea = new J_EAProfile(engineGC, OL_EnergyCarriers.HEAT, profile, null , energyModel.p_timeStep_h);
j_ea.energyAssetName = engineGC.p_ownerID + " custom building heat profile";

return max(profile)/energyModel.p_timeStep_h;
Expand Down