org.powertac.common
Class TariffTransaction

java.lang.Object
  extended by org.powertac.common.BrokerTransaction
      extended by org.powertac.common.TariffTransaction

public class TariffTransaction
extends BrokerTransaction

A TariffTransaction instance represents the kWh of energy consumed (kWh < 0) or produced kWh > 0 by some members of a specific customer model, in a specific timeslot, under a particular tariff. Note that this is an immutable type, and therefore is not auditable. Instances are created by the TariffMarket and communicated to brokers to represent customer interactions with tariffs (subscribe, consume, etc.).

Author:
Carsten Block, John Collins

Nested Class Summary
static class TariffTransaction.Type
           
 
Field Summary
 
Fields inherited from class org.powertac.common.BrokerTransaction
broker, id, postedTime
 
Constructor Summary
TariffTransaction(Broker broker, org.joda.time.Instant when, TariffTransaction.Type txType, TariffSpecification spec, CustomerInfo customer, int customerCount, double kWh, double charge)
          Creates a new TariffTransaction for broker of type txType against a particular tariff spec and customer.
 
Method Summary
 double getCharge()
          Returns the debit (negative) or credit (positive) to the broker's money account represented by this transaction.
 int getCustomerCount()
          Number of individual customers within the customer model represented by this transaction.
 CustomerInfo getCustomerInfo()
           
 double getKWh()
          Returns the debit (negative) or credit (positive) to the broker's energy account in the current timeslot represented by this transaction.
 TariffSpecification getTariffSpec()
           
 TariffTransaction.Type getTxType()
           
 String toString()
           
 
Methods inherited from class org.powertac.common.BrokerTransaction
getBroker, getId, getPostedTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TariffTransaction

public TariffTransaction(Broker broker,
                         org.joda.time.Instant when,
                         TariffTransaction.Type txType,
                         TariffSpecification spec,
                         CustomerInfo customer,
                         int customerCount,
                         double kWh,
                         double charge)
Creates a new TariffTransaction for broker of type txType against a particular tariff spec and customer. Energy quantity and charge is specified from the Broker's viewpoint, so a consumption transaction would have kwh < 0 and charge > 0.

Method Detail

getTxType

public TariffTransaction.Type getTxType()

getCustomerInfo

public CustomerInfo getCustomerInfo()

getCustomerCount

public int getCustomerCount()
Number of individual customers within the customer model represented by this transaction. The value will always be less than or equal to the population represented by the customerInfo.


getKWh

public double getKWh()
Returns the debit (negative) or credit (positive) to the broker's energy account in the current timeslot represented by this transaction.


getCharge

public double getCharge()
Returns the debit (negative) or credit (positive) to the broker's money account represented by this transaction.


getTariffSpec

public TariffSpecification getTariffSpec()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.