@Domain public class TariffSubscription extends Object
| Constructor and Description |
|---|
TariffSubscription(CustomerInfo customer,
Tariff tariff)
You need a CustomerInfo and a Tariff to create one of these.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deferredUnsubscribe(int customerCount)
Handles the actual unsubscribe operation.
|
void |
ensureRegulationCapacity()
Ensures that regulationAccumulator is non-null -
needed for non-regulatable customer models
|
double |
getCurtailment()
Deprecated.
Use getRegulation() instead, but remember that it returns
a per-member value, while this method returns an aggregate value.
|
CustomerInfo |
getCustomer() |
int |
getCustomersCommitted() |
int |
getExpiredCustomerCount()
Returns the number of individual customers who may withdraw from this
subscription without penalty.
|
long |
getId() |
double |
getRegulation()
Returns the regulation quantity exercised per member
in the previous timeslot.
|
RegulationAccumulator |
getRemainingRegulationCapacity()
Returns the maximum aggregate up-regulation possible after the
customer model has run and possibly applied economic controls.
|
Tariff |
getTariff() |
double |
getTotalUsage() |
Tariff |
handleRevokedTariff()
Handles the subscription switch in case the underlying Tariff has been
revoked.
|
boolean |
hasRegulationRate()
True just in case this subscription allows regulation.
|
void |
postBalancingControl(double kwh)
Posts a BalancingControlEvent to the subscription and generate the correct
TariffTransaction.
|
void |
postRatioControl(double ratio)
Posts the ratio for an EconomicControlEvent to the subscription for the
current timeslot.
|
void |
setCustomersCommitted(int value) |
void |
setRegulation(double newValue) |
void |
setRegulationCapacity(RegulationCapacity capacity)
Communicates the ability of the customer model to handle regulation
requests.
|
void |
subscribe(int customerCount)
Subscribes some number of discrete customers.
|
void |
unsubscribe(int customerCount)
Removes customerCount customers (at most) from this subscription,
posts early-withdrawal fees if appropriate.
|
void |
usePower(double kwh)
Generates and posts a TariffTransaction instance for the current timeslot that
represents the amount of production (negative amount) or consumption
(positive amount), along with the credit/debit that results.
|
public TariffSubscription(CustomerInfo customer, Tariff tariff)
public long getId()
public CustomerInfo getCustomer()
public Tariff getTariff()
public int getCustomersCommitted()
@StateChange public void setCustomersCommitted(int value)
public double getTotalUsage()
@StateChange public void subscribe(int customerCount)
public void unsubscribe(int customerCount)
@StateChange public void deferredUnsubscribe(int customerCount)
public Tariff handleRevokedTariff()
public void usePower(double kwh)
@Deprecated public double getCurtailment()
public double getRegulation()
@StateChange public void setRegulation(double newValue)
@StateChange public void setRegulationCapacity(RegulationCapacity capacity)
public void ensureRegulationCapacity()
public boolean hasRegulationRate()
@StateChange public void postRatioControl(double ratio)
@StateChange public void postBalancingControl(double kwh)
public RegulationAccumulator getRemainingRegulationCapacity()
public int getExpiredCustomerCount()
Copyright © 2017 Power TAC. All rights reserved.