public StepInfo (Timeslot slot, TariffSubscription sub) { super(); timeslot = slot; subscription = sub; regulationAccumulator = new RegulationAccumulator(0.0, 0.0); }
/** * 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)); } }
/** * 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)); }
return new RegulationAccumulator(0.0, 0.0); + ":" + 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);
@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; }
/** * 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); }
if (customerCount == customersCommitted) { setRegulationCap(new RegulationAccumulator(0.0, 0.0)); setRegulation(0.0);