public StepInfo (Timeslot slot, TariffSubscription sub) { super(); timeslot = slot; subscription = sub; regulationAccumulator = new RegulationAccumulator(0.0, 0.0); }
public void addRegulationCapacity (RegulationAccumulator capacity) { regulationAccumulator.add(capacity); }
/** * Sets the up-regulation value. * Argument must be non-negative. */ public void setUpRegulationCapacity (double value) { double filteredValue = filterValue(value); if (filteredValue < 0.0) { log.warn("Attempt to set negative up-regulation capacity " + filteredValue); return; } upRegulationCapacity = filteredValue; }
/** * Adds the capacities in the given RegulationAccumulator instance to this * instance. */ public void add (RegulationAccumulator rc) { setUpRegulationCapacity(upRegulationCapacity + rc.upRegulationCapacity); setDownRegulationCapacity(downRegulationCapacity + rc.downRegulationCapacity); }
@Override public RegulationAccumulator getRegulationCapacity (BalancingOrder order) { Tariff tariff = tariffRepo.findTariffById(order.getTariffId()); if (null == tariff) { // broker error, most likely log.warn("Null tariff " + order.getTariffId() + " for balancing order"); return new RegulationAccumulator(0.0, 0.0); } RegulationAccumulator result = new RegulationAccumulator(0.0, 0.0); List<TariffSubscription> subs = tariffSubscriptionRepo.findSubscriptionsForTariff(tariff); for (TariffSubscription sub : subs) { result.add(sub.getRemainingRegulationCapacity()); } log.info("BalancingOrder " + order.getId() + " capacity = (" + result.getUpRegulationCapacity() + "," + result.getDownRegulationCapacity() + ")"); return result; }
* regulationAccumulator.getDownRegulationCapacity(); regulationAccumulator.setDownRegulationCapacity(regulationAccumulator .getDownRegulationCapacity() - result); if (regulationAccumulator.getUpRegulationCapacity() > proposedUsage) { double excess = regulationAccumulator.getUpRegulationCapacity() - proposedUsage; result = proposedUsage + (pendingRegulationRatio - 1.0) * excess; regulationAccumulator.setUpRegulationCapacity(regulationAccumulator .getUpRegulationCapacity() - result); pendingRegulationRatio * regulationAccumulator.getUpRegulationCapacity(); regulationAccumulator.setUpRegulationCapacity(regulationAccumulator .getUpRegulationCapacity() - result); log.debug("proposedUpRegulation=" + proposedUpRegulation + ", maxUpRegulation=" + mur); regulationAccumulator.setUpRegulationCapacity(mur - result);
return new RegulationAccumulator(0.0, 0.0); regulationAccumulator.getUpRegulationCapacity() * customersCommitted; double down = regulationAccumulator.getDownRegulationCapacity() * customersCommitted; if (0 == pendingUnsubscribeCount) { log.info("regulation capacity for " + getCustomer().getName() + ":" + this.getTariff().getId() + " (" + up + ", " + down + ")"); return new RegulationAccumulator(up, down); + " reduced by " + ratio + " to (" + up * ratio + ", " + down * ratio + ")"); return new RegulationAccumulator(up * ratio, down * ratio);
if (kwh > 0) { amts.put(sub, value.getUpRegulationCapacity()); available += value.getUpRegulationCapacity(); amts.put(sub, value.getDownRegulationCapacity()); available += value.getDownRegulationCapacity();
if (customerCount == customersCommitted) { setRegulationCap(new RegulationAccumulator(0.0, 0.0)); setRegulation(0.0); regulationAccumulator.setDownRegulationCapacity(0.0); regulationAccumulator.setUpRegulationCapacity(0.0);
/** * Adds the given amount of up-regulation capacity. * Amount must be non-negative. */ public void addUpRegulation (double amount) { if (amount < 0.0) { log.warn("Attempt to add negative up-regulation capacity " + amount); return; } setUpRegulationCapacity(upRegulationCapacity + amount); }
/** * Adds the given amount of down-regulation capacity. * Amount must be non-positive. */ public void addDownRegulation (double amount) { if (amount > 0.0) { log.warn("Attempt to add positive down-regulation capacity " + amount); return; } setDownRegulationCapacity(downRegulationCapacity + amount); }
if (kWhPerMember >= 0.0) { regulationAccumulator.setUpRegulationCapacity(regulationAccumulator .getUpRegulationCapacity() - kWhPerMember); regulationAccumulator.setDownRegulationCapacity(regulationAccumulator .getDownRegulationCapacity() - kWhPerMember);
capacityControlService.getRegulationCapacity(bo.balancingOrder); log.info("tariff " + bo.balancingOrder.getTariffId() + ": up=" + cap.getUpRegulationCapacity() + ", down=" + cap.getDownRegulationCapacity()); if (sgn < 0.0) { bo.availableCapacity = cap.getUpRegulationCapacity(); bo.availableCapacity = cap.getDownRegulationCapacity();
/** * Ensures that regulationAccumulator is non-null - * needed for non-regulatable customer models */ public void ensureRegulationCapacity () { if (null == regulationAccumulator) { setRegulationCap(new RegulationAccumulator(0.0, 0.0)); } }
/** * Sets the down-regulation value. * Argument must be non-negative. */ //@StateChange public void setDownRegulationCapacity (double value) { double filteredValue = filterValue(value); if (filteredValue > 0.0) { log.warn("Attempt to set positive down-regulation capacity " + filteredValue); return; } downRegulationCapacity = filteredValue; }
/** * Alternate constructor for logtool analyzers in which Tariffs cannot * be reconstructed. */ public TariffSubscription (CustomerInfo customer, long tariffId) { super(); this.customer = customer; this.tariffId = tariffId; expirations = new ArrayList<ExpirationRecord>(); setRegulationCap(new RegulationAccumulator(0.0, 0.0)); }
/** * You need a CustomerInfo and a Tariff to create one of these. */ public TariffSubscription (CustomerInfo customer, Tariff tariff) { super(); this.customer = customer; this.tariff = tariff; this.tariffId = tariff.getId(); expirations = new ArrayList<ExpirationRecord>(); setRegulationCap(new RegulationAccumulator(0.0, 0.0)); }
/** * Communicates the ability of the customer model to handle regulation * requests. Quantities are per-member. * * NOTE: This method must be called once/timeslot for any customer that * offers regulation capacity, because otherwise the capacity will be * carried over from the previous timeslot. */ //@StateChange public void setRegulationCapacity (RegulationCapacity capacity) { double upRegulation = capacity.getUpRegulationCapacity(); double downRegulation = getTariff().overpricedDownRegulationRatio() * capacity.getDownRegulationCapacity(); regulationAccumulator = new RegulationAccumulator(upRegulation, downRegulation); }