@Override public PowerType getPowerType () { return customerInfo.getPowerType(); }
/** * 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); }
/** * 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; }
private Tariff getDefaultTariff () { return getTariffMarket().getDefaultTariff(customerInfo.getPowerType()); }
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()); } }
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()); } }
.getDefaultTariff(cust.getPowerType()), cust, cust.getPopulation()); customerRepo.add(cust);
if (customer.getPowerType() == PowerType.INTERRUPTIBLE_CONSUMPTION) {
if (customer.getPowerType() == PowerType.INTERRUPTIBLE_CONSUMPTION) { List<TariffSubscription> subs = service.getTariffSubscriptionRepo()
log.info(bundle.getName() + ": Submitting " + rec.getOpinions().size() + " profile suggestions to " + bundle.getCustomerInfo().getPowerType() + " capacity originator: " + capacityOriginator.getCapacityName()); log.info(bundle.getName() + ": No beneficial profile permutations for " + bundle.getCustomerInfo().getPowerType() + " capacity originator: " + capacityOriginator.getCapacityName());
return true; case BENEFIT: if (capacityOriginator.getParentBundle().getCustomerInfo().getPowerType() .isConsumption()) {
HashSet<Tariff> newTariffs = new LinkedHashSet<>(getTariffRepo() .findRecentActiveTariffs(tariffEvalDepth, customerInfo.getPowerType()));