@Service
public class TariffMarketService
extends org.powertac.common.interfaces.TimeslotPhaseProcessor
implements org.powertac.common.interfaces.TariffMarket, org.powertac.common.interfaces.InitializationService
| Constructor and Description |
|---|
TariffMarketService()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
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() |
void |
handleMessage(org.powertac.common.msg.BalancingOrder msg)
Processes an incoming BalancingOrder by storing it in the tariffRepo
|
void |
handleMessage(org.powertac.common.msg.EconomicControlEvent msg)
Processes an incoming ControlEvent from a broker
|
void |
handleMessage(org.powertac.common.msg.TariffExpire update)
Handles changes in tariff expiration date.
|
void |
handleMessage(org.powertac.common.msg.TariffRevoke update)
Handles tariff revocation.
|
void |
handleMessage(org.powertac.common.TariffSpecification spec)
Processes a newly-published tariff.
|
void |
handleMessage(org.powertac.common.msg.VariableRateUpdate update)
Applies a new HourlyCharge to an existing Tariff with a variable Rate.
|
String |
initialize(org.powertac.common.Competition competition,
List<String> completedInits)
Reads configuration parameters, registers for timeslot phase activation.
|
void |
processRevokedTariffs()
Runs through the list of pending tariff revocations, marking the tariffs
and their subscriptions.
|
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) |
void |
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.
|
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 handleMessage(org.powertac.common.TariffSpecification spec)
public void handleMessage(org.powertac.common.msg.TariffExpire update)
public void handleMessage(org.powertac.common.msg.TariffRevoke update)
public void handleMessage(org.powertac.common.msg.VariableRateUpdate update)
public void handleMessage(org.powertac.common.msg.EconomicControlEvent msg)
public void handleMessage(org.powertac.common.msg.BalancingOrder msg)
public void processRevokedTariffs()
processRevokedTariffs in interface org.powertac.common.interfaces.TariffMarketpublic void registerNewTariffListener(org.powertac.common.interfaces.NewTariffListener listener)
registerNewTariffListener in interface org.powertac.common.interfaces.TariffMarketpublic void activate(org.joda.time.Instant time,
int phase)
activate in class org.powertac.common.interfaces.TimeslotPhaseProcessorpublic 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 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 void setDefaults()
setDefaults in interface org.powertac.common.interfaces.InitializationServiceCopyright © 2014 Power TAC. All Rights Reserved.