org.powertac.common.interfaces
Interface TariffMarket


public interface TariffMarket

Tariff Market Receives, validates, and stores new tariffs, enforces tariff validity rules. Generates transactions to represent tariff publication fees. Provides convenience methods to find tariffs that might be of interest to Customers.

Note that all methods driven by messages from the incoming message channel are polymorphic methods that select by argument type at runtime. They all return a TariffStatus instance that can be routed back to the originating broker.

Author:
John Collins

Method Summary
 List<org.powertac.common.Tariff> getActiveTariffList(org.powertac.common.enumerations.PowerType type)
          Returns the list of currently active tariffs for the given PowerType.
 org.powertac.common.Tariff getDefaultTariff(org.powertac.common.enumerations.PowerType type)
          Returns the default tariff.
 org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.TariffExpire update)
          Processes incoming TariffUpdateCmd from a broker that can be used to revoke a tariff or change its expiration date.
 org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.TariffRevoke update)
          Processes incoming TariffUpdateCmd from a broker that can be used to revoke a tariff or change its expiration date.
 org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.TariffSpecification spec)
          Processes incoming TariffSpecification of a broker, turns it into a Tariff instance, and validates it.
 org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.VariableRateUpdate update)
          Processes HourlyCharge updates for variable rates.
 void registerNewTariffListener(NewTariffListener listener)
          Registers a listener for publication of new Tariffs.
 boolean setDefaultTariff(org.powertac.common.TariffSpecification newTariff)
          Convenience method to set the default tariff at the beginning of the game.
 TariffSubscription subscribeToTariff(org.powertac.common.Tariff tariff, org.powertac.common.CustomerInfo customer, int customerCount)
          Subscribes a block of Customers from a single Customer model to the specified Tariff, as long as the Tariff has not expired.
 

Method Detail

processTariff

org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.TariffSpecification spec)
Processes incoming TariffSpecification of a broker, turns it into a Tariff instance, and validates it. Returns a TariffStatus instance that can be routed back to the originating broker.


processTariff

org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.TariffExpire update)
Processes incoming TariffUpdateCmd from a broker that can be used to revoke a tariff or change its expiration date.


processTariff

org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.TariffRevoke update)
Processes incoming TariffUpdateCmd from a broker that can be used to revoke a tariff or change its expiration date.


processTariff

org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.VariableRateUpdate update)
Processes HourlyCharge updates for variable rates.


subscribeToTariff

TariffSubscription subscribeToTariff(org.powertac.common.Tariff tariff,
                                     org.powertac.common.CustomerInfo customer,
                                     int customerCount)
Subscribes a block of Customers from a single Customer model to the specified Tariff, as long as the Tariff has not expired. If the subscription succeeds, then the TariffSubscription instance is return, otherwise null.

Note that you cannot unsubscribe directly from a Tariff -- you have to do that from the TariffSubscription that represents the Tariff you want to unsubscribe from.


getActiveTariffList

List<org.powertac.common.Tariff> getActiveTariffList(org.powertac.common.enumerations.PowerType type)
Returns the list of currently active tariffs for the given PowerType. The list contains only non-expired tariffs that cover the given type.


getDefaultTariff

org.powertac.common.Tariff getDefaultTariff(org.powertac.common.enumerations.PowerType type)
Returns the default tariff.


setDefaultTariff

boolean setDefaultTariff(org.powertac.common.TariffSpecification newTariff)
Convenience method to set the default tariff at the beginning of the game. Returns true just in case the tariff was valid and was successfully saved.


registerNewTariffListener

void registerNewTariffListener(NewTariffListener listener)
Registers a listener for publication of new Tariffs.



Copyright © 2012 Power TAC. All Rights Reserved.