Package org.powertac.common.interfaces
Interface Accounting
-
public interface Accounting
Common interface for the PowerTAC accounting service. The accouting service module is responsible for bookeeping, with respect to cash (broker bank accounts) and market positions on behalf of brokers. All activities that could potentially affect cash or market positions must be recorded by making calls on the Accounting API. Summaries of accounts, along with all new transactions, are sent to brokers at the end of each timeslot.Accounting is also a TimeslotPhaseProcessor, running in the last phase of the simulation cycle. All processors that can generate transactions must run in earlier phases.
- Author:
- John Collins
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activate(org.joda.time.Instant time, int phase)
Runs the accounting process.BalancingTransaction
addBalancingTransaction(Broker broker, double imbalance, double charge)
Adds a balancing transaction to represent the cost of imbalanceCapacityTransaction
addCapacityTransaction(Broker broker, int peakTimeslot, double threshold, double kWh, double fee)
Adds a capacity transaction to represent charges for contribution to a demand peak.DistributionTransaction
addDistributionTransaction(Broker broker, int nSmall, int nLarge, double transport, double distroCharge)
Adds a distribution transaction to represent charges for customer connections and energy transport.MarketTransaction
addMarketTransaction(Broker broker, Timeslot timeslot, double price, double mWh)
Adds a market transaction that includes both a cash component and a product commitment for a specific timeslot.TariffTransaction
addRegulationTransaction(Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
Adds a tariff transaction representing a curtailment or balancing action to the current-hour transaction list.TariffTransaction
addTariffTransaction(TariffTransaction.Type txType, Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
Adds a tariff transaction to the current-hour transaction list.double
getCurrentMarketPosition(Broker broker)
Returns the market position for the current timeslot for a given broker.double
getCurrentNetLoad(Broker broker)
Returns the current net load represented by unprocessed TariffTransactions for a specific Broker.Map<Broker,Map<TariffTransaction.Type,Double>>
getCurrentSupplyDemandByBroker()
Returns a mapping of brokers to total supply and demand among subscribed customers.List<TariffTransaction>
getPendingTariffTransactions()
Returns the list of pending tariff transactions for the current timeslot.void
postBalancingControl(BalancingControlEvent bce)
Updates a broker's cash position resulting from the Balancing Market payment for Demand Response exercise.
-
-
-
Method Detail
-
addMarketTransaction
MarketTransaction addMarketTransaction(Broker broker, Timeslot timeslot, double price, double mWh)
Adds a market transaction that includes both a cash component and a product commitment for a specific timeslot.
-
addTariffTransaction
TariffTransaction addTariffTransaction(TariffTransaction.Type txType, Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
Adds a tariff transaction to the current-hour transaction list.
-
addRegulationTransaction
TariffTransaction addRegulationTransaction(Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
Adds a tariff transaction representing a curtailment or balancing action to the current-hour transaction list.
-
addDistributionTransaction
DistributionTransaction addDistributionTransaction(Broker broker, int nSmall, int nLarge, double transport, double distroCharge)
Adds a distribution transaction to represent charges for customer connections and energy transport.
-
addCapacityTransaction
CapacityTransaction addCapacityTransaction(Broker broker, int peakTimeslot, double threshold, double kWh, double fee)
Adds a capacity transaction to represent charges for contribution to a demand peak. One is generated for each peak event.- Parameters:
broker
-peakTimeslot
- when the peak occurredthreshold
- assessment thresholdkWh
- total net demand among broker's customers during timeslotfee
- assessed capacity fee for this peak event
-
addBalancingTransaction
BalancingTransaction addBalancingTransaction(Broker broker, double imbalance, double charge)
Adds a balancing transaction to represent the cost of imbalance
-
postBalancingControl
void postBalancingControl(BalancingControlEvent bce)
Updates a broker's cash position resulting from the Balancing Market payment for Demand Response exercise.
-
getCurrentNetLoad
double getCurrentNetLoad(Broker broker)
Returns the current net load represented by unprocessed TariffTransactions for a specific Broker. This is needed to run the balancing process.
-
getCurrentSupplyDemandByBroker
Map<Broker,Map<TariffTransaction.Type,Double>> getCurrentSupplyDemandByBroker()
Returns a mapping of brokers to total supply and demand among subscribed customers.
-
getCurrentMarketPosition
double getCurrentMarketPosition(Broker broker)
Returns the market position for the current timeslot for a given broker. Needed to run the balancing process.
-
getPendingTariffTransactions
List<TariffTransaction> getPendingTariffTransactions()
Returns the list of pending tariff transactions for the current timeslot. List will be non-empty only after the customer models have begun reporting tariff transactions, and before the accounting service has run.
-
activate
void activate(org.joda.time.Instant time, int phase)
Runs the accounting process. This needs to be here to support some tests
-
-