Package org.powertac.common
Class HourlyCharge
- java.lang.Object
- 
- org.powertac.common.state.XStreamStateLoggable
- 
- org.powertac.common.HourlyCharge
 
 
- 
- All Implemented Interfaces:
- Comparable<HourlyCharge>
 
 @Domain(fields={"rateId","value","atTime"}) public class HourlyCharge extends XStreamStateLoggable implements Comparable<HourlyCharge> Represents the cost of power during a specific timeslot in a variable Rate. The value slot represents the charge/kWh; atTime is the Instant at the start of the relevant timeslot. Therefore, the charge is in effect from atTime until atTime + 1 hour. These are created by brokers and sent to the server to update tariff pricing. State log fields for readResolve():
 new(long rateId, double value, Instant atTime)- Author:
- jcollins
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected org.joda.time.InstantatTime
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedHourlyCharge()HourlyCharge(org.joda.time.Instant when, double charge)Creates a new HourlyCharge to communicate rate information to customers.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(HourlyCharge obj)org.joda.time.InstantgetAtTime()longgetId()longgetRateId()doublegetValue()voidsetRateId(long rateId)Sets connection between rate and hourly charge.- 
Methods inherited from class org.powertac.common.state.XStreamStateLoggablereadResolve
 
- 
 
- 
- 
- 
Constructor Detail- 
HourlyChargepublic HourlyCharge(org.joda.time.Instant when, double charge)Creates a new HourlyCharge to communicate rate information to customers. Thewhenparameter specifies when this charge takes effect. The specified charge/kWh applies until the next HourlyCharge takes effect on the same Rate. Note that the numbers are interpreted from the viewpoint of the Customer, so if the customer is expected to pay the broker, the value should be negative (a debit).
 - 
HourlyChargeprotected HourlyCharge() 
 
- 
 - 
Method Detail- 
getIdpublic long getId() 
 - 
setRateId@StateChange public void setRateId(long rateId) Sets connection between rate and hourly charge. An instance with the default rateId is not considered complete. This method is intended to be called from Rate when the instance is added to the rate.
 - 
getRateIdpublic long getRateId() 
 - 
getValuepublic double getValue() 
 - 
getAtTimepublic org.joda.time.Instant getAtTime() 
 - 
compareTopublic int compareTo(HourlyCharge obj) - Specified by:
- compareToin interface- Comparable<HourlyCharge>
 
 
- 
 
-