@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)
Adds a balancing transaction to represent the cost of imbalance
|
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.
|
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 mWh,
double price)
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 |
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)
Initializes a plugin prior to the beginning of a game.
|
void |
postBalancingControl(BalancingControlEvent bce)
Updates a broker's cash position resulting from the Balancing Market
payment for Demand Response exercise.
|
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)
InitializationServiceinitialize in interface InitializationServicepublic MarketTransaction addMarketTransaction(Broker broker, Timeslot timeslot, double mWh, double price)
AccountingaddMarketTransaction in interface Accountingpublic TariffTransaction addTariffTransaction(TariffTransaction.Type txType, Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
AccountingaddTariffTransaction in interface Accountingpublic TariffTransaction addRegulationTransaction(Tariff tariff, CustomerInfo customer, int customerCount, double kWh, double charge)
AccountingaddRegulationTransaction in interface Accountingpublic DistributionTransaction addDistributionTransaction(Broker broker, int nSmall, int nLarge, double transport, double distroCharge)
AccountingaddDistributionTransaction in interface Accountingpublic BalancingTransaction addBalancingTransaction(Broker broker, double kWh, double charge)
AccountingaddBalancingTransaction in interface Accountingpublic CapacityTransaction addCapacityTransaction(Broker broker, int peakTimeslot, double threshold, double kWh, double fee)
AccountingaddCapacityTransaction in interface AccountingpeakTimeslot - when the peak occurredthreshold - assessment thresholdkWh - total net demand among broker's customers during timeslotfee - assessed capacity fee for this peak eventpublic void postBalancingControl(BalancingControlEvent bce)
AccountingpostBalancingControl 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 © 2017 Power TAC. All rights reserved.