|
||||||||||
| 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 |
double |
getMaxPublicationFee()
|
double |
getMaxRevocationFee()
|
double |
getMinPublicationFee()
|
double |
getMinRevocationFee()
|
Double |
getPublicationFee()
|
int |
getPublicationInterval()
|
int |
getPublicationOffset()
|
Double |
getRevocationFee()
|
String |
initialize(org.powertac.common.Competition competition,
List<String> completedInits)
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)
|
void |
setDefaults()
|
boolean |
setDefaultTariff(org.powertac.common.TariffSpecification newSpec)
|
void |
setPublicationInterval(int interval)
|
void |
setPublicationOffset(int offset)
|
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 String initialize(org.powertac.common.Competition competition,
List<String> completedInits)
initialize in interface org.powertac.common.interfaces.InitializationServicepublic double getMinPublicationFee()
public double getMaxPublicationFee()
public Double getPublicationFee()
public double getMinRevocationFee()
public double getMaxRevocationFee()
public Double getRevocationFee()
public int getPublicationInterval()
@ConfigurableValue(valueType="Integer",
description="Number of timeslots between tariff publication events. Must be at most 24.")
public void setPublicationInterval(int interval)
public int getPublicationOffset()
@ConfigurableValue(valueType="Integer",
description="Number of timeslots from the first timeslot to delay the first publication event. It does not work well to make this zero, because brokers do not have an opportunity to post tariffs in timeslot 0.")
public void setPublicationOffset(int offset)
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.TariffMarketpublic void setDefaults()
setDefaults in interface org.powertac.common.interfaces.InitializationService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||