Class AccountingService

    • Constructor Detail

      • AccountingService

        public AccountingService()
    • Method Detail

      • postBalancingControl

        public void postBalancingControl​(org.powertac.common.msg.BalancingControlEvent bce)
        Specified by:
        postBalancingControl in interface Accounting
      • getCurrentNetLoad

        public double getCurrentNetLoad​(Broker broker)
        Returns the net load for the given broker in the current timeslot. Note that this only works AFTER the customer models have run, and BEFORE the day's transactions have been processed. The value will be negative if the broker's customers are consuming more than they produce in the current timeslot.
        Specified by:
        getCurrentNetLoad in interface Accounting
      • getCurrentMarketPosition

        public double getCurrentMarketPosition​(Broker broker)
        Gets the net market position for the current timeslot. This only works on processed transactions, but it can be used before activation in case there can be no new market transactions for the current timeslot. This is the normal case. The value will be positive if the broker is importing power during the current timeslot.
        Specified by:
        getCurrentMarketPosition in interface Accounting
      • activate

        public void activate​(org.joda.time.Instant time,
                             int phaseNumber)
        Processes the pending transaction list, computes interest, sends updates to brokers
        Specified by:
        activate in interface Accounting
        Specified by:
        activate in class TimeslotPhaseProcessor
      • processTransaction

        public 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.
      • processTransaction

        public void processTransaction​(BalancingTransaction tx,
                                       ArrayList<Object> messages)
        Processes a balancing transaction by updating the broker's cash position.
      • processTransaction

        public void processTransaction​(DistributionTransaction tx,
                                       ArrayList<Object> messages)
        Processes a distribution transaction by updating the broker's cash position.
      • processTransaction

        public void processTransaction​(CapacityTransaction tx,
                                       ArrayList<Object> messages)
        Processes a capacity transaction by updating the broker's cash position.
      • processTransaction

        public void processTransaction​(MarketTransaction tx,
                                       ArrayList<Object> messages)
        Processes a market transaction by ensuring that the market position will be sent to the broker. Actual transaction posting is deferred to delivery time
      • handleMarketTransactionsForTimeslot

        public void handleMarketTransactionsForTimeslot​(Timeslot ts)
        Processes deferred market transactions for the current timeslot by updating the broker's cash position.
      • processTransaction

        public void processTransaction​(BankTransaction tx,
                                       ArrayList<Object> messages)
        Complains if a bank transaction is among the transactions to be handled. These should be generated locally and sent directly to brokers.
      • getPendingTariffTransactions

        public List<TariffTransaction> getPendingTariffTransactions()
        Returns the current list of pending tariff transactions. This will be non-empty only after the customer model has run and before accounting has run in the current timeslot.
        Specified by:
        getPendingTariffTransactions in interface Accounting
      • getMinInterest

        public double getMinInterest()
        Returns the low end of the bank interest range.
      • getMaxInterest

        public double getMaxInterest()
        Returns the high end of the bank interest range.
      • getBankInterest

        public Double getBankInterest()
        Returns the actual bank interest once configuration is complete.