@Test public void testInitialize () { assertEquals(uut.getName(), "test", "correct name"); when(seed.nextDouble()).thenReturn(0.5); init(); assertEquals(-35.0, uut.getMinTemp(), 1e-6, "correct min temp"); assertEquals(-10.0, uut.getMaxTemp(), 1e-6, "correct max temp"); assertEquals(-22.5, uut.getCurrentTemp(), 1e-6, "correct current temp"); assertEquals(15.0, uut.getCurrentNcUsage(), 1e-6, "correct nc usage"); }
@Override public void initialize () { super.initialize(); log.info("Initialize " + name); powerType = PowerType.THERMAL_STORAGE_CONSUMPTION; CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withCustomerClass(CustomerClass.LARGE) .withControllableKW(-unitSize / cop) .withStorageCapacity(stockCapacity * CP_ICE * (maxTemp - minTemp)) .withUpRegulationKW(-unitSize / cop) .withDownRegulationKW(unitSize / cop); addCustomerInfo(info); ensureSeeds(); if (null == currentTemp) { setCurrentTemp(minTemp + (maxTemp - minTemp) * opSeed.nextDouble()); currentStock = stockCapacity; } currentNcUsage = nonCoolingUsage; tariffEvaluator = createTariffEvaluator(this); tariffEvaluator.withInertia(0.7).withPreferredContractDuration(14); tariffEvaluator.initializeInconvenienceFactors(0.0, 0.01, 0.0, 0.0); tariffEvaluator.initializeRegulationFactors(-getMaxCooling() * 0.05, 0.0, getMaxCooling() * 0.04); }
ColdStorage extends AbstractCustomer implements CustomerModelAccessor { @Override public void initialize () { super.initialize(); log.info("Initialize " + name); powerType = PowerType.THERMAL_STORAGE_CONSUMPTION; CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withCustomerClass(CustomerClass.LARGE) .withControllableKW(-unitSize / cop) .withStorageCapacity(stockCapacity * CP_ICE * (maxTemp - minTemp)) .withUpRegulationKW(-unitSize / cop) .withDownRegulationKW(unitSize / cop); addCustomerInfo(info); ensureSeeds(); if (null == currentTemp) { setCurrentTemp(minTemp + (maxTemp - minTemp) * opSeed.nextDouble()); currentStock = stockCapacity; } currentNcUsage = nonCoolingUsage; tariffEvaluator = createTariffEvaluator(this); tariffEvaluator.withInertia(0.7).withPreferredContractDuration(14); tariffEvaluator.initializeInconvenienceFactors(0.0, 0.01, 0.0, 0.0); tariffEvaluator.initializeRegulationFactors(-getMaxCooling() * 0.05, 0.0, getMaxCooling() * 0.04); } }
ColdStorage extends AbstractCustomer implements CustomerModelAccessor { @Override public void initialize () { super.initialize(); log.info("Initialize " + name); powerType = PowerType.THERMAL_STORAGE_CONSUMPTION; CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withCustomerClass(CustomerClass.LARGE) .withControllableKW(-unitSize / cop) .withStorageCapacity(stockCapacity * CP_ICE * (maxTemp - minTemp)) .withUpRegulationKW(-unitSize / cop) .withDownRegulationKW(unitSize / cop); addCustomerInfo(info); ensureSeeds(); if (null == currentTemp) { setCurrentTemp(minTemp + (maxTemp - minTemp) * opSeed.nextDouble()); currentStock = stockCapacity; } currentNcUsage = nonCoolingUsage; tariffEvaluator = createTariffEvaluator(this); tariffEvaluator.withInertia(0.7).withPreferredContractDuration(14); tariffEvaluator.initializeInconvenienceFactors(0.0, 0.01, 0.0, 0.0); tariffEvaluator.initializeRegulationFactors(-getMaxCooling() * 0.05, 0.0, getMaxCooling() * 0.04); } ColdStorage();  ColdStorage(String name); }
ColdStorage extends AbstractCustomer implements CustomerModelAccessor { @Override public void initialize () { super.initialize(); log.info("Initialize " + name); powerType = PowerType.THERMAL_STORAGE_CONSUMPTION; CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withCustomerClass(CustomerClass.LARGE) .withControllableKW(-unitSize / cop) .withStorageCapacity(stockCapacity * CP_ICE * (maxTemp - minTemp)) .withUpRegulationKW(-unitSize / cop) .withDownRegulationKW(unitSize / cop); addCustomerInfo(info); ensureSeeds(); if (null == currentTemp) { setCurrentTemp(minTemp + (maxTemp - minTemp) * opSeed.nextDouble()); currentStock = stockCapacity; } currentNcUsage = nonCoolingUsage; tariffEvaluator = createTariffEvaluator(this); tariffEvaluator.withInertia(0.7).withPreferredContractDuration(14); tariffEvaluator.initializeInconvenienceFactors(0.0, 0.01, 0.0, 0.0); tariffEvaluator.initializeRegulationFactors(-getMaxCooling() * 0.05, 0.0, getMaxCooling() * 0.04); } ColdStorage();  ColdStorage(String name); @Override void initialize(); @Override CustomerInfo getCustomerInfo(); @Override void step(); @Override void evaluateTariffs(List<Tariff> tariffs); @Override CapacityProfile getCapacityProfile(Tariff tariff); @Override double getBrokerSwitchFactor(boolean isSuperseding); @Override double getTariffChoiceSample(); @Override double getInertiaSample(); double getCurrentTemp(); @StateChange void setCurrentTemp(double temp); double getMinTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "minimum allowable temperature") @StateChange ColdStorage withMinTemp(double temp); double getMaxTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "maximum allowable temperature") @StateChange ColdStorage withMaxTemp(double temp); double getNominalTemp(); @ConfigurableValue(valueType = "Double", description = "allowable temperature change to save money on TOU tariffs") @StateChange void setShiftSag(double deltaT); double getShiftSag(); @ConfigurableValue(valueType = "Double", dump = false, description = "assumed outdoor temp for tariff evaluation") @StateChange void setEvalEnvTemp(double temp); double getEvalEnvTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "nominal internal temperature") @StateChange ColdStorage withNominalTemp(double temp); double getNewStockTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "Temperature of incoming stock") @StateChange ColdStorage withNewStockTemp(double temp); double getStockCapacity(); @ConfigurableValue(valueType = "Double", dump = false, description = "Typical inventory in tonnes of H2O") @StateChange ColdStorage withStockCapacity(double value); double getTurnoverRatio(); @ConfigurableValue(valueType = "Double", description = "Ratio of stock that gets replaced daily") @StateChange ColdStorage withTurnoverRatio(double ratio); double getRoofArea(); @ConfigurableValue(valueType = "Double", dump = false, description = "Area of roof") @StateChange ColdStorage withRoofArea(double area); double getRoofRValue(); @ConfigurableValue(valueType = "Double", description = "R-value of roof insulation") @StateChange ColdStorage withRoofRValue(double value); double getWallArea(); @ConfigurableValue(valueType = "Double", dump = false, description = "Total area of outside walls") @StateChange ColdStorage withWallArea(double area); double getWallRValue(); @ConfigurableValue(valueType = "Double", description = "R-value of wall insulation") @StateChange ColdStorage withWallRValue(double value); double getFloorRValue(); @ConfigurableValue(valueType = "Double", description = "R-value of floor insulation") @StateChange ColdStorage withFloorRValue(double value); double getInfiltrationRatio(); @ConfigurableValue(valueType = "Double", dump = false, description = "Infiltration loss as proportion of wall + roof loss") @StateChange ColdStorage withInfiltrationRatio(double value); double getUnitSize(); @ConfigurableValue(valueType = "Double", dump = false, description = "Thermal capacity in tons of cooling plant") @StateChange ColdStorage withUnitSize(double cap); double getCop(); @ConfigurableValue(valueType = "Double", dump = false, description = "Coefficient of Performance of refrigeration unit") @StateChange ColdStorage withCop(double value); double getHysteresis(); @ConfigurableValue(valueType = "Double", dump = false, description = "Control range for refrigeration unit") @StateChange ColdStorage withHysteresis(double value); double getNonCoolingUsage(); @ConfigurableValue(valueType = "Double", dump = false, description = "Mean hourly energy usage for non-cooling purposes") @StateChange ColdStorage withNonCoolingUsage(double value); @Override double getShiftingInconvenienceFactor(Tariff tariff); }
ColdStorage extends AbstractCustomer implements CustomerModelAccessor { @Override public void initialize () { super.initialize(); log.info("Initialize " + name); powerType = PowerType.THERMAL_STORAGE_CONSUMPTION; CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withCustomerClass(CustomerClass.LARGE) .withControllableKW(-unitSize / cop) .withStorageCapacity(stockCapacity * CP_ICE * (maxTemp - minTemp)) .withUpRegulationKW(-unitSize / cop) .withDownRegulationKW(unitSize / cop); addCustomerInfo(info); ensureSeeds(); if (null == currentTemp) { setCurrentTemp(minTemp + (maxTemp - minTemp) * opSeed.nextDouble()); currentStock = stockCapacity; } currentNcUsage = nonCoolingUsage; tariffEvaluator = createTariffEvaluator(this); tariffEvaluator.withInertia(0.7).withPreferredContractDuration(14); tariffEvaluator.initializeInconvenienceFactors(0.0, 0.01, 0.0, 0.0); tariffEvaluator.initializeRegulationFactors(-getMaxCooling() * 0.05, 0.0, getMaxCooling() * 0.04); } ColdStorage();  ColdStorage(String name); @Override void initialize(); @Override CustomerInfo getCustomerInfo(); @Override void step(); @Override void evaluateTariffs(List<Tariff> tariffs); @Override CapacityProfile getCapacityProfile(Tariff tariff); @Override double getBrokerSwitchFactor(boolean isSuperseding); @Override double getTariffChoiceSample(); @Override double getInertiaSample(); double getCurrentTemp(); @StateChange void setCurrentTemp(double temp); double getMinTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "minimum allowable temperature") @StateChange ColdStorage withMinTemp(double temp); double getMaxTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "maximum allowable temperature") @StateChange ColdStorage withMaxTemp(double temp); double getNominalTemp(); @ConfigurableValue(valueType = "Double", description = "allowable temperature change to save money on TOU tariffs") @StateChange void setShiftSag(double deltaT); double getShiftSag(); @ConfigurableValue(valueType = "Double", dump = false, description = "assumed outdoor temp for tariff evaluation") @StateChange void setEvalEnvTemp(double temp); double getEvalEnvTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "nominal internal temperature") @StateChange ColdStorage withNominalTemp(double temp); double getNewStockTemp(); @ConfigurableValue(valueType = "Double", dump = false, description = "Temperature of incoming stock") @StateChange ColdStorage withNewStockTemp(double temp); double getStockCapacity(); @ConfigurableValue(valueType = "Double", dump = false, description = "Typical inventory in tonnes of H2O") @StateChange ColdStorage withStockCapacity(double value); double getTurnoverRatio(); @ConfigurableValue(valueType = "Double", description = "Ratio of stock that gets replaced daily") @StateChange ColdStorage withTurnoverRatio(double ratio); double getRoofArea(); @ConfigurableValue(valueType = "Double", dump = false, description = "Area of roof") @StateChange ColdStorage withRoofArea(double area); double getRoofRValue(); @ConfigurableValue(valueType = "Double", description = "R-value of roof insulation") @StateChange ColdStorage withRoofRValue(double value); double getWallArea(); @ConfigurableValue(valueType = "Double", dump = false, description = "Total area of outside walls") @StateChange ColdStorage withWallArea(double area); double getWallRValue(); @ConfigurableValue(valueType = "Double", description = "R-value of wall insulation") @StateChange ColdStorage withWallRValue(double value); double getFloorRValue(); @ConfigurableValue(valueType = "Double", description = "R-value of floor insulation") @StateChange ColdStorage withFloorRValue(double value); double getInfiltrationRatio(); @ConfigurableValue(valueType = "Double", dump = false, description = "Infiltration loss as proportion of wall + roof loss") @StateChange ColdStorage withInfiltrationRatio(double value); double getUnitSize(); @ConfigurableValue(valueType = "Double", dump = false, description = "Thermal capacity in tons of cooling plant") @StateChange ColdStorage withUnitSize(double cap); double getCop(); @ConfigurableValue(valueType = "Double", dump = false, description = "Coefficient of Performance of refrigeration unit") @StateChange ColdStorage withCop(double value); double getHysteresis(); @ConfigurableValue(valueType = "Double", dump = false, description = "Control range for refrigeration unit") @StateChange ColdStorage withHysteresis(double value); double getNonCoolingUsage(); @ConfigurableValue(valueType = "Double", dump = false, description = "Mean hourly energy usage for non-cooling purposes") @StateChange ColdStorage withNonCoolingUsage(double value); @Override double getShiftingInconvenienceFactor(Tariff tariff);  }