|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.powertac.common.Tariff
public class Tariff
Entity wrapper for TariffSpecification that supports Tariff evaluation and billing. Instances of this class are not intended to be serialized. Tariffs are composed of Rates, which may be applicable for limited daily and/or weekly times, and within particular usage tiers. The Tariff transforms the list of Rates into an array, indexed first by tier and second by hour, making it easy to find the correct Rate that applies for a particular accounting event. This will also make it easy to estimate the cost of a multi-Rate Tariff given an expected load/production profile.
This is not a serializable type; The server and brokers are responsible for creating and maintaining their own Tariff entities if they have an interest in the transformation of TariffSpecification represented by a Tariff instance.
NOTE: When creating one of these for the first time, you must call the init() method to initialize the publication date. It does not work to call it inside the constructor for some reason.
| Nested Class Summary | |
|---|---|
static class |
Tariff.State
|
| Constructor Summary | |
|---|---|
Tariff(TariffSpecification spec)
Creates a new Tariff from the given TariffSpecification. |
|
| Method Summary | |
|---|---|
boolean |
addHourlyCharge(HourlyCharge newCharge,
long rateId)
Adds a new HourlyCharge to its Rate. |
Broker |
getBroker()
|
double |
getEarlyWithdrawPayment()
Payment from customer to broker for canceling subscription before minDuration has elapsed. |
org.joda.time.Instant |
getExpiration()
|
long |
getId()
make id a synonym for specId |
Tariff |
getIsSupersededBy()
|
double |
getMaxCurtailment(double kwh,
double cumulativeUsage)
Returns the maximum interruptible quantity in kwh for this tariff in the current timeslot, for the specified proposed and cumulative usage. |
long |
getMinDuration()
Delegation for TariffSpecification.minDuration |
org.joda.time.Instant |
getOfferDate()
|
double |
getPeriodicPayment()
Flat payment per period for two-part tariffs, typically negative. |
PowerType |
getPowerType()
Type of power covered by this tariff |
double |
getRealizedPrice()
Returns the actual realized price, or 0.0 if information unavailable. |
double |
getSignupPayment()
One-time payment for subscribing to tariff, negative for payment from customer, positive for payment to customer. |
long |
getSpecId()
|
Tariff.State |
getState()
|
TariffSpecification |
getTariffSpec()
|
TariffSpecification |
getTariffSpecification()
|
double |
getTotalCost()
|
double |
getTotalUsage()
|
double |
getUsageCharge(double kwh,
double cumulativeUsage,
boolean recordUsage)
Returns the usage charge for a single customer in the current timeslot. |
double |
getUsageCharge(org.joda.time.Instant when,
double kwh,
double cumulativeUsage)
Returns the usage charge for a single customer using an amount of energy at some time in the past or future. |
void |
init()
Initializes tariff by building the rate map. |
boolean |
isActive()
True just in case this tariff is OFFERED or ACTIVE |
boolean |
isAnalyzed()
Returns the analyzed flag. |
boolean |
isCovered()
True just in case the set of Rates cover all the possible hour and tier slots. |
boolean |
isExpired()
True just in case the current time is past the expiration date of this Tariff. |
boolean |
isRevoked()
True just in case this tariff has been revoked. |
boolean |
isWeekly()
|
void |
setExpiration(org.joda.time.Instant newDate)
|
void |
setState(Tariff.State newState)
Updates the state of this tariff. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Tariff(TariffSpecification spec)
| Method Detail |
|---|
public void init()
public TariffSpecification getTariffSpecification()
public long getSpecId()
public long getId()
public boolean addHourlyCharge(HourlyCharge newCharge,
long rateId)
public double getRealizedPrice()
public long getMinDuration()
public PowerType getPowerType()
public double getSignupPayment()
public double getEarlyWithdrawPayment()
public double getPeriodicPayment()
public double getMaxCurtailment(double kwh,
double cumulativeUsage)
public double getUsageCharge(double kwh,
double cumulativeUsage,
boolean recordUsage)
If the recordUsage parameter is true, then the usage and price will be recorded to update the realizedPrice.
public double getUsageCharge(org.joda.time.Instant when,
double kwh,
double cumulativeUsage)
public org.joda.time.Instant getExpiration()
public boolean isExpired()
public void setExpiration(org.joda.time.Instant newDate)
public org.joda.time.Instant getOfferDate()
public boolean isCovered()
public TariffSpecification getTariffSpec()
public Broker getBroker()
public Tariff.State getState()
public void setState(Tariff.State newState)
public boolean isActive()
public Tariff getIsSupersededBy()
public double getTotalCost()
public double getTotalUsage()
public boolean isWeekly()
public boolean isRevoked()
public boolean isAnalyzed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||