|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.powertac.common.interfaces.TimeslotPhaseProcessor
org.powertac.tariffmarket.TariffMarketService
@Service public class TariffMarketService
Implements the Tariff Market abstraction. Incoming tariff-related messages from brokers are received and processed, tariffs are published periodically, and subscriptions are processed on behalf of customers.
| Constructor Summary | |
|---|---|
TariffMarketService()
Default constructor |
|
| Method Summary | |
|---|---|
void |
activate(org.joda.time.Instant time,
int phase)
|
List<org.powertac.common.Tariff> |
getActiveTariffList(org.powertac.common.enumerations.PowerType type)
|
org.powertac.common.Tariff |
getDefaultTariff(org.powertac.common.enumerations.PowerType type)
Returns the default tariff |
int |
getPublicationInterval()
|
double |
getTariffPublicationFee()
|
double |
getTariffRevocationFee()
|
void |
init(org.powertac.common.PluginConfig config)
Reads configuration parameters, registers for timeslot phase activation. |
org.powertac.common.msg.TariffStatus |
processTariff(org.powertac.common.msg.TariffExpire update)
Handles changes in tariff expiration date. |
org.powertac.common.msg.TariffStatus |
processTariff(org.powertac.common.msg.TariffRevoke update)
Handles tariff revocation. |
org.powertac.common.msg.TariffStatus |
processTariff(org.powertac.common.TariffSpecification spec)
Processes a newly-published tariff. |
org.powertac.common.msg.TariffStatus |
processTariff(org.powertac.common.msg.VariableRateUpdate update)
Applies a new HourlyCharge to an existing Tariff with a variable Rate. |
void |
receiveMessage(Object msg)
Receives and dispatches an incoming broker message. |
void |
registerNewTariffListener(org.powertac.common.interfaces.NewTariffListener listener)
|
boolean |
setDefaultTariff(org.powertac.common.TariffSpecification newSpec)
|
org.powertac.common.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 this Tariff, as long as this Tariff has not expired. |
| Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor |
|---|
init, setTimeslotPhase |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TariffMarketService()
| Method Detail |
|---|
public void init(org.powertac.common.PluginConfig config)
public double getTariffPublicationFee()
public double getTariffRevocationFee()
public int getPublicationInterval()
public void receiveMessage(Object msg)
receiveMessage in interface org.powertac.common.interfaces.BrokerMessageListenerpublic org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.TariffSpecification spec)
processTariff in interface org.powertac.common.interfaces.TariffMarketpublic org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.TariffExpire update)
processTariff in interface org.powertac.common.interfaces.TariffMarketpublic org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.TariffRevoke update)
processTariff in interface org.powertac.common.interfaces.TariffMarketpublic org.powertac.common.msg.TariffStatus processTariff(org.powertac.common.msg.VariableRateUpdate update)
processTariff in interface org.powertac.common.interfaces.TariffMarketpublic void registerNewTariffListener(org.powertac.common.interfaces.NewTariffListener listener)
registerNewTariffListener in interface org.powertac.common.interfaces.TariffMarket
public void activate(org.joda.time.Instant time,
int phase)
activate in class org.powertac.common.interfaces.TimeslotPhaseProcessor
public org.powertac.common.TariffSubscription subscribeToTariff(org.powertac.common.Tariff tariff,
org.powertac.common.CustomerInfo customer,
int customerCount)
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.
subscribeToTariff in interface org.powertac.common.interfaces.TariffMarketpublic List<org.powertac.common.Tariff> getActiveTariffList(org.powertac.common.enumerations.PowerType type)
getActiveTariffList in interface org.powertac.common.interfaces.TariffMarketpublic org.powertac.common.Tariff getDefaultTariff(org.powertac.common.enumerations.PowerType type)
getDefaultTariff in interface org.powertac.common.interfaces.TariffMarketpublic boolean setDefaultTariff(org.powertac.common.TariffSpecification newSpec)
setDefaultTariff in interface org.powertac.common.interfaces.TariffMarket
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||