Skip to content
Merged
12 changes: 6 additions & 6 deletions _alp/Agents/Zero_Interface/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2427,15 +2427,15 @@ Pair<ShapeEmbeddedObjectPresentation, Point> f_getPresentationPositionIteration(

double f_initialChargerOrder()
{/*ALCODESTART::1750247111856*/
c_orderedV1GChargers = new ArrayList<J_EACharger>();
c_orderedV2GChargers = new ArrayList<J_EACharger>();
c_orderedV1GChargers = new ArrayList<J_EAChargePoint>();
c_orderedV2GChargers = new ArrayList<J_EAChargePoint>();
c_orderedPublicChargers = new ArrayList<GCPublicCharger>();

List<J_EACharger> c_inactiveV1GChargers = new ArrayList<J_EACharger>();
List<J_EACharger> c_inactiveV2GChargers = new ArrayList<J_EACharger>();
List<J_EAChargePoint> c_inactiveV1GChargers = new ArrayList<J_EAChargePoint>();
List<J_EAChargePoint> c_inactiveV2GChargers = new ArrayList<J_EAChargePoint>();

for (GridConnection gc : energyModel.f_getActiveGridConnections()) {
for (J_EACharger charger : gc.c_chargers) {
for (J_EAChargePoint charger : gc.c_chargers) {
if (charger.V1GCapable) {
c_orderedV1GChargers.add(0, charger);
}
Expand All @@ -2452,7 +2452,7 @@ Pair<ShapeEmbeddedObjectPresentation, Point> f_getPresentationPositionIteration(
}

for (GridConnection gc : energyModel.f_getPausedGridConnections()) {
for (J_EACharger charger : gc.c_chargers) {
for (J_EAChargePoint charger : gc.c_chargers) {
if (charger.V1GCapable) {
c_inactiveV1GChargers.add(0, charger);
}
Expand Down
4 changes: 2 additions & 2 deletions _alp/Agents/Zero_Interface/Variables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,7 @@
<ShowLabel>true</ShowLabel>
<Properties SaveInSnapshot="true" AccessType="public" StaticVariable="false">
<CollectionClass>ArrayList</CollectionClass>
<ElementClass>J_EACharger</ElementClass>
<ElementClass>J_EAChargePoint</ElementClass>
<ValueElementClass>String</ValueElementClass>
</Properties>
</Variable>
Expand Down Expand Up @@ -3247,7 +3247,7 @@
<ShowLabel>true</ShowLabel>
<Properties SaveInSnapshot="true" AccessType="public" StaticVariable="false">
<CollectionClass>ArrayList</CollectionClass>
<ElementClass>J_EACharger</ElementClass>
<ElementClass>J_EAChargePoint</ElementClass>
<ValueElementClass>String</ValueElementClass>
</Properties>
</Variable>
Expand Down
59 changes: 30 additions & 29 deletions _alp/Agents/Zero_Loader/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1640,8 +1640,7 @@ GISRegion f_createGISRegionChargingStation(double lat,double lon)
//Is active at start?
chargingStation.v_isActive = dataChargingStation.initially_active();

//Set charging attitude: MAX_POWER should always be the starting case for charge stations to prevent more charging than possible
chargingStation.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.MAX_SPREAD);
//chargingStation.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.SIMPLE);

//Create and connect owner
ConnectionOwner owner = energyModel.add_pop_connectionOwners();
Expand Down Expand Up @@ -1680,7 +1679,7 @@ GISRegion f_createGISRegionChargingStation(double lat,double lon)
List<J_ChargingSession> chargerProfile = f_getChargerProfile();
boolean V1GCapable = randomTrue(avgc_data.p_v1gProbability);
boolean V2GCapable = randomTrue(avgc_data.p_v2gProbability);
new J_EACharger(chargingStation, chargingStation.p_maxChargingPower_kW, energyModel.p_timeStep_h, chargerProfile, V1GCapable, V2GCapable);
new J_EAChargePoint(chargingStation, chargingStation.p_maxChargingPower_kW, energyModel.p_timeStep_h, chargerProfile, V1GCapable, V2GCapable, 2);
}
else{
for(int k = 0; k < chargingStation.p_nbOfChargers*avgc_data.p_avgVehiclesPerChargePoint; k++ ){
Expand Down Expand Up @@ -1726,9 +1725,9 @@ GISRegion f_createGISRegionChargingStation(double lat,double lon)
//Create vehicles that charge at the charging station
if(chargingStation.p_chargingVehicleType == OL_EnergyAssetType.CHARGER){
List<J_ChargingSession> chargerProfile = f_getChargerProfile();
boolean V1GCapable = randomTrue(avgc_data.p_v1gProbability);
boolean V2GCapable = randomTrue(avgc_data.p_v2gProbability);
new J_EACharger(chargingStation, chargingStation.p_maxChargingPower_kW, energyModel.p_timeStep_h, chargerProfile, V1GCapable, V2GCapable);
boolean V1GCapable = true; //randomTrue(avgc_data.p_v1gProbability);
boolean V2GCapable = true; //randomTrue(avgc_data.p_v2gProbability);
new J_EAChargePoint(chargingStation, chargingStation.p_maxChargingPower_kW, energyModel.p_timeStep_h, chargerProfile, V1GCapable, V2GCapable, 2);
}
else{
for(int k = 0; k < avgc_data.p_avgVehiclesPerChargePoint; k++ ){
Expand Down Expand Up @@ -3085,8 +3084,8 @@ J_ChargingSession f_createChargingSession(String chargingSessionData)
{/*ALCODESTART::1749648772203*/
String[] chargingSessionInfo = chargingSessionData.split("/");

int startIndex = Integer.parseInt(chargingSessionInfo[0]);
int endIndex = Integer.parseInt(chargingSessionInfo[1]);
double startIndex = Double.parseDouble(chargingSessionInfo[0]);
double endIndex = Double.parseDouble(chargingSessionInfo[1]);
double chargingDemand_kWh = Double.parseDouble(chargingSessionInfo[2]);
double batteryCap_kWh = Double.parseDouble(chargingSessionInfo[3]);
double chargingPower_kW = Double.parseDouble(chargingSessionInfo[5]);
Expand Down Expand Up @@ -3384,7 +3383,7 @@ else if (GCH.p_bouwjaar < 2015) {
double f_addEnergyAssetsToHouses(GCHouse house,double jaarlijksElectriciteitsVerbruik)
{/*ALCODESTART::1749728889986*/
//Add generic electricity demand profile
GridNode gn = randomWhere(energyModel.pop_gridNodes, x -> x.p_gridNodeID.equals( house.p_parentNodeElectricID));
GridNode gn = randomWhere(energyModel.pop_gridNodes, x -> x.p_gridNodeID.equals( house.p_parentNodeElectricID)); // Why random??
if ( ! gn.p_hasProfileData ){
f_addElectricityDemandProfile(house, jaarlijksElectriciteitsVerbruik, null, false, "default_house_electricity_demand_fr");
}
Expand Down Expand Up @@ -3432,26 +3431,28 @@ else if (GCH.p_bouwjaar < 2015) {

double f_setHouseHeatingPreferences(GCHouse house)
{/*ALCODESTART::1749728889988*/
if( randomTrue(0.5) ){ //50% kans op ochtend ritme
house.v_nightTempSetpoint_degC = uniform_discr(12,18);
house.v_dayTempSetpoint_degC = uniform_discr(18, 24);
house.v_heatingOn_time = uniform_discr(5,10) + uniform_discr(0,4) / 4.0;
house.v_heatingOff_time = uniform_discr(21,23);
house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0,1),1);
}
else if (randomTrue(0.5) ){ // 25% kans op hele dag aan
house.v_nightTempSetpoint_degC = uniform_discr(18,21);
house.v_dayTempSetpoint_degC = house.v_nightTempSetpoint_degC;
house.v_heatingOn_time = -1;
house.v_heatingOff_time = 25;
house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0, 1),1);
}
else { // 25% kans op smiddags/savonds aan
house.v_nightTempSetpoint_degC = uniform_discr(12,18);
house.v_dayTempSetpoint_degC = uniform_discr(18, 24);
house.v_heatingOn_time = uniform_discr(14, 16) + uniform_discr(0,4) / 4.0;
house.v_heatingOff_time = uniform_discr(21,23);
house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0, 1),1);
if (house.p_heatingManagement instanceof J_HeatingManagementSimple heatingManagement) {
if( randomTrue(0.5) ){ //50% kans op ochtend ritme
heatingManagement.nightTimeSetPoint_degC = uniform_discr(12,18);
heatingManagement.dayTimeSetPoint_degC = uniform_discr(18, 24);
heatingManagement.startOfDay_h = uniform_discr(5,10) + uniform_discr(0,4) / 4.0;
heatingManagement.startOfNight_h = uniform_discr(21,23);
// house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0,1),1);
}
else if (randomTrue(0.5) ){ // 25% kans op hele dag aan
heatingManagement.nightTimeSetPoint_degC = uniform_discr(18,21);
heatingManagement.dayTimeSetPoint_degC = heatingManagement.nightTimeSetPoint_degC;
heatingManagement.startOfDay_h= -1;
heatingManagement.startOfNight_h = 25;
//house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0, 1),1);
}
else { // 25% kans op smiddags/savonds aan
heatingManagement.nightTimeSetPoint_degC = uniform_discr(12,18);
heatingManagement.dayTimeSetPoint_degC = uniform_discr(18, 24);
heatingManagement.startOfDay_h = uniform_discr(14, 16) + uniform_discr(0,4) / 4.0;
heatingManagement.startOfNight_h = uniform_discr(21,23);
//house.p_heatingKickinTreshold_degC = roundToDecimal(uniform(0, 1),1);
}
}
/*ALCODEEND*/}

Expand Down
8 changes: 4 additions & 4 deletions _alp/Agents/tabElectricity/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ else if ( gc instanceof GCUtility ) {
int nbChargersGoal = roundToInt(goal_pct / 100.0 * totalNbChargers);

while (currentNbChargers < nbChargersGoal) {
J_EACharger j_ea = findFirst(zero_Interface.c_orderedV1GChargers, x -> !x.V1GCapable);
J_EAChargePoint j_ea = findFirst(zero_Interface.c_orderedV1GChargers, x -> !x.V1GCapable);
j_ea.V1GCapable = true;
currentNbChargers++;
zero_Interface.c_orderedV1GChargers.remove(j_ea);
zero_Interface.c_orderedV1GChargers.add(0, j_ea);

}
while (currentNbChargers > nbChargersGoal) {
J_EACharger j_ea = findFirst(zero_Interface.c_orderedV1GChargers, x -> x.V1GCapable);
J_EAChargePoint j_ea = findFirst(zero_Interface.c_orderedV1GChargers, x -> x.V1GCapable);
j_ea.V1GCapable = false;
currentNbChargers--;
zero_Interface.c_orderedV1GChargers.remove(j_ea);
Expand All @@ -542,15 +542,15 @@ else if ( gc instanceof GCUtility ) {
int nbChargersGoal = roundToInt(goal_pct / 100.0 * totalNbChargers);

while (currentNbChargers < nbChargersGoal) {
J_EACharger j_ea = findFirst(zero_Interface.c_orderedV2GChargers, x -> !x.V2GCapable);
J_EAChargePoint j_ea = findFirst(zero_Interface.c_orderedV2GChargers, x -> !x.V2GCapable);
j_ea.V2GCapable = true;
currentNbChargers++;
zero_Interface.c_orderedV2GChargers.remove(j_ea);
zero_Interface.c_orderedV2GChargers.add(0, j_ea);

}
while (currentNbChargers > nbChargersGoal) {
J_EACharger j_ea = findFirst(zero_Interface.c_orderedV2GChargers, x -> x.V2GCapable);
J_EAChargePoint j_ea = findFirst(zero_Interface.c_orderedV2GChargers, x -> x.V2GCapable);
j_ea.V2GCapable = false;
currentNbChargers--;
zero_Interface.c_orderedV2GChargers.remove(j_ea);
Expand Down
21 changes: 15 additions & 6 deletions _alp/Agents/tabElectricity/Levels/Level.level.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2149,32 +2149,41 @@ f_setResidentialBatteries( sl_householdBatteriesResidentialArea_pct.getValue(),
gr_settingsV2G.setVisible(false);

for( GCHouse house : zero_Interface.energyModel.Houses ){
house.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.SIMPLE);
//house.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.SIMPLE);
house.f_addChargingManagementToGC(OL_ChargingAttitude.SIMPLE, false);
house.f_activateV2GChargingMode(false);
}
for( GCPublicCharger publicCharger : zero_Interface.energyModel.PublicChargers ){
publicCharger.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.SIMPLE);
//publicCharger.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.SIMPLE);
publicCharger.f_activateV2GChargingMode(false);
}
break;
case 1:
gr_settingsV1G.setVisible(true);
gr_settingsV2G.setVisible(false);

for( GCHouse house : zero_Interface.energyModel.Houses ){
house.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.V1G);
//house.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.BALANCE);
house.f_addChargingManagementToGC(OL_ChargingAttitude.BALANCE, false);
house.f_activateV2GChargingMode(false);
}
for( GCPublicCharger publicCharger : zero_Interface.energyModel.PublicChargers ){
publicCharger.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.V1G);
//publicCharger.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.PRICE);
publicCharger.f_activateV2GChargingMode(false);
}
break;
case 2:
gr_settingsV1G.setVisible(false);
gr_settingsV2G.setVisible(true);

for( GCHouse house : zero_Interface.energyModel.Houses ){
house.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.V2G);
//house.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.V2G);
house.f_addChargingManagementToGC(OL_ChargingAttitude.BALANCE, false);
house.f_activateV2GChargingMode(true);
}
for( GCPublicCharger publicCharger : zero_Interface.energyModel.PublicChargers ){
publicCharger.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.V2G);
//publicCharger.set_p_chargingAttitudeVehicles(OL_ChargingAttitude.V2G);
publicCharger.f_activateV2GChargingMode(true);
}
break;
}
Expand Down
6 changes: 1 addition & 5 deletions _alp/Agents/tabHeating/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ int f_setHeatingSystemsWithCompanyUI(List<GCUtility> gcList,double targetHeatPum
house.f_removeAllHeatingAssets();
house.p_parentNodeHeat = null;
house.p_parentNodeHeatID = null;

//house.p_heatingType = OL_GridConnectionHeatingType.GASBURNER;
house.v_districtHeatDelivery_kW = 0;


//add gasburner
J_EAConsumption heatDemandAsset = findFirst(house.c_consumptionAssets, j_ea -> j_ea.energyAssetType == OL_EnergyAssetType.HEAT_DEMAND);
J_EAConversionGasBurner gasBurner;
Expand Down Expand Up @@ -429,7 +426,6 @@ else if (house.p_BuildingThermalAsset != null){
for (GCHouse house: zero_Interface.energyModel.Houses ) {
// Disconnect from GridNode Heat
house.p_parentNodeHeat = null;
house.v_districtHeatDelivery_kW = 0;

// Remove Heatpump and replace with gasburner
house.f_removeAllHeatingAssets();
Expand Down
2 changes: 1 addition & 1 deletion _alp/Agents/tabMobility/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ else if (vehicle instanceof J_EAHydrogenVehicle){

double f_setChargingAttitude(OL_ChargingAttitude selectedChargingAttitude,List<GridConnection> gcList)
{/*ALCODESTART::1754990674760*/
gcList.forEach(x -> x.set_p_chargingAttitudeVehicles(selectedChargingAttitude));
gcList.forEach(x -> x.f_addChargingManagementToGC(selectedChargingAttitude, false));


//Update variable to change to custom scenario
Expand Down
17 changes: 8 additions & 9 deletions _alp/Agents/tabMobility/Levels/Level.level.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ f_setElectricVans( zero_Interface.energyModel.f_getActiveGridConnections(), sl_e
<Enabled>true</Enabled>
<ActionCode>OL_ChargingAttitude selectedChargingAttitude = OL_ChargingAttitude.SIMPLE;
if(cb_spreadChargingEVs.isSelected()){
selectedChargingAttitude = OL_ChargingAttitude.MAX_SPREAD;
selectedChargingAttitude = OL_ChargingAttitude.MAX_POWER;
}

f_setChargingAttitude(selectedChargingAttitude, uI_Tabs.f_getSliderGridConnections_all());</ActionCode>
Expand Down Expand Up @@ -1207,17 +1207,17 @@ f_setChargingAttitude(selectedChargingAttitude, uI_Tabs.f_getSliderGridConnectio
<ActionCode>OL_ChargingAttitude selectedChargingAttitude = null;

switch(cb_setChargingAttitude.getValue()){
case "Simpel":
case "Standaard":
selectedChargingAttitude = OL_ChargingAttitude.SIMPLE;
break;
case "Gelimiteerd vermogen":
selectedChargingAttitude = OL_ChargingAttitude.MAX_POWER;
break;
case "Slimme spreiding":
/*case "Slimme spreiding":
selectedChargingAttitude = OL_ChargingAttitude.MAX_SPREAD;
break;
case "V2G":
selectedChargingAttitude = OL_ChargingAttitude.V2G;
break;*/
case "Prijsgestuurd":
selectedChargingAttitude = OL_ChargingAttitude.PRICE;
break;
case "Custom":
selectedChargingAttitude = null;
Expand All @@ -1231,10 +1231,9 @@ if(selectedChargingAttitude != null){
<ExtendedProperties>
<Font Name="Dialog" Size="11" Style="0"/>
<Editable>false</Editable>
<Button>Simpel</Button>
<Button>Standaard</Button>
<Button>Gelimiteerd vermogen</Button>
<Button>Slimme spreiding</Button>
<Button>V2G</Button>
<Button>Prijsgestuurd</Button>
<Button>Custom</Button>
<LinkTo>false</LinkTo>
</ExtendedProperties>
Expand Down
4 changes: 2 additions & 2 deletions _alp/Classes/Class.J_ModelSave.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class J_ModelSave implements Serializable {
public ArrayList<J_EAVehicle> c_orderedVehiclesPrivateParking;
public ArrayList<GIS_Object> c_orderedParkingSpaces;

public ArrayList<J_EACharger> c_orderedV1GChargers;
public ArrayList<J_EACharger> c_orderedV2GChargers;
public ArrayList<J_EAChargePoint> c_orderedV1GChargers;
public ArrayList<J_EAChargePoint> c_orderedV2GChargers;
public ArrayList<GCPublicCharger> c_orderedPublicChargers;

/**
Expand Down