@Service
public class AccountingService
extends org.powertac.common.interfaces.TimeslotPhaseProcessor
implements org.powertac.common.interfaces.Accounting, org.powertac.common.interfaces.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
|
org.powertac.common.BalancingTransaction |
addBalancingTransaction(org.powertac.common.Broker broker,
double kWh,
double charge) |
org.powertac.common.CapacityTransaction |
addCapacityTransaction(org.powertac.common.Broker broker,
int peakTimeslot,
double threshold,
double kWh,
double fee) |
org.powertac.common.DistributionTransaction |
addDistributionTransaction(org.powertac.common.Broker broker,
int nSmall,
int nLarge,
double transport,
double distroCharge) |
org.powertac.common.MarketTransaction |
addMarketTransaction(org.powertac.common.Broker broker,
org.powertac.common.Timeslot timeslot,
double mWh,
double price) |
org.powertac.common.TariffTransaction |
addRegulationTransaction(org.powertac.common.Tariff tariff,
org.powertac.common.CustomerInfo customer,
int customerCount,
double kWh,
double charge) |
org.powertac.common.TariffTransaction |
addTariffTransaction(org.powertac.common.TariffTransaction.Type txType,
org.powertac.common.Tariff tariff,
org.powertac.common.CustomerInfo customer,
int customerCount,
double kWh,
double charge) |
Double |
getBankInterest()
Returns the actual bank interest once configuration is complete.
|
double |
getCurrentMarketPosition(org.powertac.common.Broker broker)
Gets the net market position for the current timeslot.
|
double |
getCurrentNetLoad(org.powertac.common.Broker broker)
Returns the net load for the given broker in the current timeslot.
|
Map<org.powertac.common.Broker,Map<org.powertac.common.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<org.powertac.common.TariffTransaction> |
getPendingTariffTransactions()
Returns the current list of pending tariff transactions.
|
void |
handleMarketTransactionsForTimeslot(org.powertac.common.Timeslot ts)
Processes deferred market transactions for the current timeslot
by updating the broker's cash position.
|
String |
initialize(org.powertac.common.Competition competition,
List<String> completedInits) |
void |
processTransaction(org.powertac.common.BalancingTransaction tx,
ArrayList<Object> messages)
Processes a balancing transaction by updating the broker's cash position.
|
void |
processTransaction(org.powertac.common.BankTransaction tx,
ArrayList<Object> messages)
Complains if a bank transaction is among the transactions to be
handled.
|
void |
processTransaction(org.powertac.common.CapacityTransaction tx,
ArrayList<Object> messages)
Processes a capacity transaction by updating the broker's cash position.
|
void |
processTransaction(org.powertac.common.DistributionTransaction tx,
ArrayList<Object> messages)
Processes a distribution transaction by updating the
broker's cash position.
|
void |
processTransaction(org.powertac.common.MarketTransaction tx,
ArrayList<Object> messages)
Processes a market transaction by ensuring that the market position
will be sent to the broker.
|
void |
processTransaction(org.powertac.common.TariffTransaction tx,
ArrayList<Object> messages)
Processes a tariff transaction, updating the broker's cash position
and the consumption, production data in the distribution report.
|
public String initialize(org.powertac.common.Competition competition, List<String> completedInits)
initialize in interface org.powertac.common.interfaces.InitializationServicepublic org.powertac.common.MarketTransaction addMarketTransaction(org.powertac.common.Broker broker,
org.powertac.common.Timeslot timeslot,
double mWh,
double price)
addMarketTransaction in interface org.powertac.common.interfaces.Accountingpublic org.powertac.common.TariffTransaction addTariffTransaction(org.powertac.common.TariffTransaction.Type txType,
org.powertac.common.Tariff tariff,
org.powertac.common.CustomerInfo customer,
int customerCount,
double kWh,
double charge)
addTariffTransaction in interface org.powertac.common.interfaces.Accountingpublic org.powertac.common.TariffTransaction addRegulationTransaction(org.powertac.common.Tariff tariff,
org.powertac.common.CustomerInfo customer,
int customerCount,
double kWh,
double charge)
addRegulationTransaction in interface org.powertac.common.interfaces.Accountingpublic org.powertac.common.DistributionTransaction addDistributionTransaction(org.powertac.common.Broker broker,
int nSmall,
int nLarge,
double transport,
double distroCharge)
addDistributionTransaction in interface org.powertac.common.interfaces.Accountingpublic org.powertac.common.BalancingTransaction addBalancingTransaction(org.powertac.common.Broker broker,
double kWh,
double charge)
addBalancingTransaction in interface org.powertac.common.interfaces.Accountingpublic org.powertac.common.CapacityTransaction addCapacityTransaction(org.powertac.common.Broker broker,
int peakTimeslot,
double threshold,
double kWh,
double fee)
addCapacityTransaction in interface org.powertac.common.interfaces.Accountingpublic double getCurrentNetLoad(org.powertac.common.Broker broker)
getCurrentNetLoad in interface org.powertac.common.interfaces.Accountingpublic Map<org.powertac.common.Broker,Map<org.powertac.common.TariffTransaction.Type,Double>> getCurrentSupplyDemandByBroker()
getCurrentSupplyDemandByBroker in interface org.powertac.common.interfaces.Accountingpublic double getCurrentMarketPosition(org.powertac.common.Broker broker)
getCurrentMarketPosition in interface org.powertac.common.interfaces.Accountingpublic void activate(org.joda.time.Instant time,
int phaseNumber)
activate in interface org.powertac.common.interfaces.Accountingactivate in class org.powertac.common.interfaces.TimeslotPhaseProcessorpublic void processTransaction(org.powertac.common.TariffTransaction tx,
ArrayList<Object> messages)
public void processTransaction(org.powertac.common.BalancingTransaction tx,
ArrayList<Object> messages)
public void processTransaction(org.powertac.common.DistributionTransaction tx,
ArrayList<Object> messages)
public void processTransaction(org.powertac.common.CapacityTransaction tx,
ArrayList<Object> messages)
public void processTransaction(org.powertac.common.MarketTransaction tx,
ArrayList<Object> messages)
public void handleMarketTransactionsForTimeslot(org.powertac.common.Timeslot ts)
public void processTransaction(org.powertac.common.BankTransaction tx,
ArrayList<Object> messages)
public List<org.powertac.common.TariffTransaction> getPendingTariffTransactions()
getPendingTariffTransactions in interface org.powertac.common.interfaces.Accountingpublic double getMinInterest()
public double getMaxInterest()
public Double getBankInterest()
Copyright © 2016 Power TAC. All Rights Reserved.