Commit fd1b8a3f authored by Jan Mayer's avatar Jan Mayer
Browse files

adjustments after testing

parent f784b190
......@@ -82,7 +82,7 @@ public class ClientCoupler extends Coupler {
// subscription if array with price forecast is available at the EMS
if (client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, priceFCId).getValue().getValue().getClass().isArray()) {
System.out.println(" . Coupler price is forecast array.");
System.out.println(" . Coupler price is forecast array.");
// Subscription to variable primary energy costs
Arrays.fill(opCostFC, 0.0);
......
......@@ -88,24 +88,34 @@ public class ClientDemand extends Consumer implements CurrentTimeStepSubscriber
this.setpointGridSellId = setpointGridSellId;
this.networkType = setNetworkType(client, nodeIdSector);
// Read optional Nodes
if ((costCO2FCId != null) && (this.networkType == NetworkType.ELECTRICITY)){
this.costCO2 = client.readFinalDoubleValue(costCO2FCId);
} else this.costCO2 = 0.474; // default 0.474 g/kWh
System.out.println(" . grid emission factor is set to " + this.costCO2 + " kg/kWh.");
// Read optional electricity grid Nodes
if (this.networkType == NetworkType.ELECTRICITY) {
if (costCO2FCId != null){
if (!client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, costCO2FCId)
.getValue().getValue().getClass().isArray()) {
this.costCO2 = client.readFinalDoubleValue(costCO2FCId);
System.out.println(" . gris electricity emission factor set to " + this.maxBuylimit + " kg/kWh.");
} else if (client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, maxBuyLimitId)
.getValue().getValue().getClass().isArray()) {
this.costCO2 = client.readFinalDoubleArrayValue(costCO2FCId)[0];
this.maxBuyArray = true; // subscription is necessary
}
} else this.costCO2 = 0.474; // default 0.474 g/kWh
if (maxBuyLimitId != null){
if (!client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, maxBuyLimitId)
.getValue().getValue().getClass().isArray()) {
this.maxBuylimit = client.readFinalDoubleValue(maxBuyLimitId);
System.out.println(" . max. power from grid set to " + this.maxBuylimit + " kW.");
} else if (client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, maxBuyLimitId)
.getValue().getValue().getClass().isArray()) {
this.maxBuylimit = client.readFinalDoubleArrayValue(maxBuyLimitId)[0];
this.maxBuyArray = true; // subscription is necessary
}
} else this.maxBuylimit = 9999.0;
}
Arrays.fill(networkCO2CostFC, costCO2);
if ((maxBuyLimitId != null) && (this.networkType == NetworkType.ELECTRICITY)){
if (!client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, maxBuyLimitId)
.getValue().getValue().getClass().isArray()) {
this.maxBuylimit = client.readFinalDoubleValue(maxBuyLimitId);
System.out.println(" . max. power from grid set to " + this.maxBuylimit + " kW.");
} else if (client.readValue(Integer.MAX_VALUE, TimestampsToReturn.Neither, maxBuyLimitId)
.getValue().getValue().getClass().isArray()) {
this.maxBuyArray = true; // subscription is necessary
}
} else this.maxBuylimit = 9999.0;
Arrays.fill(varNetworkBuyCap, maxBuylimit);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment