@Service public class AccountingService extends TimeslotPhaseProcessor implements Accounting, InitializationService
Accounting| Constructor and Description |
|---|
AccountingService() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(org.joda.time.Instant time,
int phaseNumber)
Processes the pending transaction list, computes interest, sends
updates to brokers
|
BalancingTransaction |
addBalancingTransaction(Broker broker,
double kWh,
double charge) |
CapacityTransaction |
addCapacityTransaction(Broker broker,
int peakTimeslot,
double threshold,
double kWh,
double fee) |
DistributionTransaction |
addDistributionTransaction(Broker broker,
int nSmall,
int nLarge,
double transport,
double distroCharge) |
MarketTransaction |
addMarketTransaction(Broker broker,
Timeslot timeslot,
double mWh,
double price) |
TariffTransaction |
addRegulationTransaction(Tariff tariff,
CustomerInfo customer,
int customerCount,
double kWh,
double charge) |
TariffTransaction |
addTariffTransaction(TariffTransaction.Type txType,
Tariff tariff,
CustomerInfo customer,
int customerCount,
double kWh,
double charge) |
Double |
getBankInterest()
Returns the actual bank interest once configuration is complete.
|
double |
getCurrentMarketPosition(Broker broker)
Gets the net market position for the current timeslot.
|
double |
getCurrentNetLoad(Broker broker)
Returns the net load for the given broker in the current timeslot.
|
Map<Broker,Map<TariffTransaction.Type,Double>> |
getCurrentSupplyDemandByBroker()
Returns a mapping of brokers to total supply and demand among subscribed
customers.
|
double |
getMaxInterest()
Returns the high end of the bank interest range.
|
double |
getMinInterest()
Returns the low end of the bank interest range.
|
List<TariffTransaction> |
getPendingTariffTransactions()
Returns the current list of pending tariff transactions.
|
void |
handleMarketTransactionsForTimeslot(Timeslot ts)
Processes deferred market transactions for the current timeslot
by updating the broker's cash position.
|
String |
initialize(Competition competition,
List<String> completedInits) |
void |
postBalancingControl(org.powertac.common.msg.BalancingControlEvent bce) |
void |
processTransaction(BalancingTransaction tx,
ArrayList<Object> messages)
Processes a balancing transaction by updating the broker's cash position.
|
void |
processTransaction(BankTransaction tx,
ArrayList<Object> messages)
Complains if a bank transaction is among the transactions to be
handled.
|
void |
processTransaction(CapacityTransaction tx,
ArrayList<Object> messages)
Processes a capacity transaction by updating the broker's cash position.
|
void |
processTransaction(DistributionTransaction tx,
ArrayList<Object> messages)
Processes a distribution transaction by updating the
broker's cash position.
|
void |
processTransaction(MarketTransaction tx,
ArrayList<Object> messages)
Processes a market transaction by ensuring that the market position
will be sent to the broker.
|
void |
processTransaction(TariffTransaction tx,
ArrayList<Object> messages)
Processes a tariff transaction, updating the broker's cash position
and the consumption, production data in the distribution report.
|
init, setTimeslotPhasepublic String initialize(Competition competition, List<String> completedInits)
initialize in interface InitializationServicepublic MarketTransaction addMarketTransaction(Broker broker, Timeslot timeslot, double mWh, double price)
addMarketTransaction in interface Accountingpublic TariffTransaction addTariffTransaction(TariffTransaction.Type txType, Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
addTariffTransaction in interface Accountingpublic TariffTransaction addRegulationTransaction(Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
addRegulationTransaction in interface Accountingpublic DistributionTransaction addDistributionTransaction(Broker broker, int nSmall, int nLarge, double transport, double distroCharge)
addDistributionTransaction in interface Accountingpublic BalancingTransaction addBalancingTransaction(Broker broker, double kWh, double charge)
addBalancingTransaction in interface Accountingpublic CapacityTransaction addCapacityTransaction(Broker broker, int peakTimeslot, double threshold, double kWh, double fee)
addCapacityTransaction in interface Accountingpublic void postBalancingControl(org.powertac.common.msg.BalancingControlEvent bce)
postBalancingControl in interface Accountingpublic double getCurrentNetLoad(Broker broker)
getCurrentNetLoad in interface Accountingpublic Map<Broker,Map<TariffTransaction.Type,Double>> getCurrentSupplyDemandByBroker()
getCurrentSupplyDemandByBroker in interface Accountingpublic double getCurrentMarketPosition(Broker broker)
getCurrentMarketPosition in interface Accountingpublic void activate(org.joda.time.Instant time,
int phaseNumber)
activate in interface Accountingactivate in class TimeslotPhaseProcessorpublic void processTransaction(TariffTransaction tx, ArrayList<Object> messages)
public void processTransaction(BalancingTransaction tx, ArrayList<Object> messages)
public void processTransaction(DistributionTransaction tx, ArrayList<Object> messages)
public void processTransaction(CapacityTransaction tx, ArrayList<Object> messages)
public void processTransaction(MarketTransaction tx, ArrayList<Object> messages)
public void handleMarketTransactionsForTimeslot(Timeslot ts)
public void processTransaction(BankTransaction tx, ArrayList<Object> messages)
public List<TariffTransaction> getPendingTariffTransactions()
getPendingTariffTransactions in interface Accountingpublic double getMinInterest()
public double getMaxInterest()
public Double getBankInterest()
Copyright © 2018 Power TAC. All rights reserved.