public void subscribeDefault (TariffMarket tariffMarketService) { for (CustomerInfo customer: getCustomerInfos()) { Tariff candidate = tariffMarketService.getDefaultTariff(customer.getPowerType()); if (null == candidate) { log.error("No default tariff for " + customer.getPowerType().toString()); } tariffMarketService.subscribeToTariff(candidate, customer, customer.getPopulation()); } }
private String getName() { return customerInfo.getName(); }
@Override public void initialize () { super.initialize(); log.info("Initialize " + name); // fill out CustomerInfo 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); // optimistic, perhaps addCustomerInfo(info); ensureSeeds(); // randomize current temp only if state not set if (null == currentTemp) { setCurrentTemp(minTemp + (maxTemp - minTemp) * opSeed.nextDouble()); currentStock = stockCapacity; } currentNcUsage = nonCoolingUsage; // set up the tariff evaluator. We are wide-open to variable pricing. tariffEvaluator = new TariffEvaluator(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); }
throw new Error("Invalid CustomerClass for " + name); customerInfo = new CustomerInfo(name, this.population) .withPowerType(pt) .withCustomerClass(cc) .withMultiContracting(this.multiContracting) .withCanNegotiate(this.canNegotiate) .withControllableKW(controllableKW) .withUpRegulationKW(upRegulationKW) .withDownRegulationKW(downRegulationKW) .withStorageCapacity(storageCapacity);
public void subscribeDefault (TariffMarket tariffMarketService) { for (CustomerInfo customer: getCustomerInfos()) { Tariff candidate = tariffMarketService.getDefaultTariff(customer.getPowerType()); if (null == candidate) { log.error("No default tariff for " + customer.getPowerType().toString()); } else { log.info("Subscribe " + customer.getName() + " to " + candidate.getPowerType().toString()); } tariffMarketService.subscribeToTariff(candidate, customer, customer.getPopulation()); } }
@Override public PowerType getPowerType () { return customerInfo.getPowerType(); }
for (String shifting: shifts) { CustomerInfo villageInfo = new CustomerInfo("Village " + i + " " + houseType + " " + shifting, houses.get(houseType)); if (shifting.equalsIgnoreCase("Base")) villageInfo.withPowerType(PowerType.CONSUMPTION); else villageInfo.withPowerType(PowerType.INTERRUPTIBLE_CONSUMPTION);
@Override public int getPopulation () { return customerInfo.getPopulation(); }
record = new CustomerRecord(customer, customer.getPopulation()); customerMap.put(customer, record); log.error("Short boot record {} for customer {} -- filling with zeros", cbd.getNetUsage().length, customer.getName());
log.info("eval tariffs for zero population {}", customerInfo.getName()); return; revoked = true; replacementTariff = currentTariff.getIsSupersededBy(); log.info("Customer " + customerInfo.getName() + ": tariff " + currentTariff.getId() + " revoked, superseded by " + ((null == replacementTariff) if (customerInfo.isMultiContracting()) {
log.info("Initialize " + name); CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withControllableKW(-interruptible) .withStorageCapacity(capacityKWh) .withUpRegulationKW(maxDischargeKW) .withDownRegulationKW(maxChargeKW); addCustomerInfo(info); ensureSeeds();
/** * Adds an additional CustomerInfo to the list */ public void addCustomerInfo (CustomerInfo info) { if (null == customerInfos.get(info.getPowerType())) { customerInfos.put(info.getPowerType(), new ArrayList<CustomerInfo>()); } customerInfos.get(info.getPowerType()).add(info); allCustomerInfos.add(info); }
new CustomerInfo("OfficeComplex " + i + " " + officeType + " " + shifting, offices.get(officeType)); if (shifting.equalsIgnoreCase("Base")) officeComplexInfo.withPowerType(PowerType.CONSUMPTION); else officeComplexInfo .withPowerType(PowerType.INTERRUPTIBLE_CONSUMPTION);
public int getPopulation (CustomerInfo customer) { return customer.getPopulation(); }
CustomerInfo info = new CustomerInfo(name, 1); info.withPowerType(powerType) .withCustomerClass(CustomerClass.LARGE) .withControllableKW(-interruptible) .withStorageCapacity(nBatteries * maxChargeKW / 3.0) .withUpRegulationKW(-nChargers * maxChargeKW) .withDownRegulationKW(nChargers * maxChargeKW); // optimistic, perhaps addCustomerInfo(info); ensureSeeds();
.getDefaultTariff(cust.getPowerType()), cust, cust.getPopulation()); customerRepo.add(cust);
/** * Returns a list of CustomerBootstrapData instances, one for each * (tariff, customer) pair. Note that this only * makes sense at the end of a bootstrap sim run. */ List<CustomerBootstrapData> getCustomerBootstrapData (int maxTimeslots) { ArrayList<CustomerBootstrapData> result = new ArrayList<>(); // iterate through the customers for (CustomerInfo customer : bootProfiles.keySet()) { CustomerRecord record = bootProfiles.get(customer); ArrayList<Double>usageList = record.bootstrapUsage; int startIndex = Math.max(0, usageList.size() - maxTimeslots); double[] usage = new double[usageList.size() - startIndex]; for (int i = 0; i < usage.length; i++) usage[i] = usageList.get(i + startIndex); result.add(new CustomerBootstrapData(customer, customer.getPowerType(), usage)); } return result; }
void signup (int population) { subscribedPopulation = Math.min(customer.getPopulation(), subscribedPopulation + population); }
customerInfo = new CustomerInfo(name, 1). withPowerType(PowerType.ELECTRIC_VEHICLE). withControllableKW(-car.getHomeChargeKW()). withUpRegulationKW(-car.getHomeChargeKW()). withDownRegulationKW(car.getHomeChargeKW()). withStorageCapacity(car.getMaxCapacity());