|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.powertac.du.DefaultBrokerService
@Service public class DefaultBrokerService
Default broker implementation. We do the implementation in a service, because the default broker is a singleton and it's convenient. The actual Broker instance is implemented in an inner class. Note that this is not a type of TimeslotPhaseProcessor. It's a broker, and so it runs after the last message of the timeslot goes out, the TimeslotComplete message. As implemented, it runs in the message-sending thread. If this turns out to cause problems with real brokers, it could run in its own thread.
| Constructor Summary | |
|---|---|
DefaultBrokerService()
Default constructor, called once when the server starts, before any application-specific initialization has been done. |
|
| Method Summary | |
|---|---|
void |
activate()
In each timeslot, we must trade in the wholesale market to satisfy the predicted load of our current customer base. |
List<Object> |
collectBootstrapData(int maxTimeslots)
Collects and returns a list of messages representing collected customer demand, market price, and weather records for the bootstrap period. |
org.powertac.common.Broker |
createBroker(String username)
Creates the internal Broker instance that can receive messages intended for local Brokers. |
double |
getBuyLimitPriceMax()
|
double |
getBuyLimitPriceMin()
|
double |
getConsumptionRate()
|
org.powertac.du.DefaultBrokerService.LocalBroker |
getFace()
|
double |
getInitialBidKWh()
|
double |
getProductionRate()
|
double |
getSellLimitPriceMax()
|
double |
getSellLimitPriceMin()
|
void |
handleMessage(org.powertac.common.CashPosition cp)
CashPosition is the last message sent by Accounting. |
void |
handleMessage(org.powertac.common.msg.CustomerBootstrapData cbd)
Handles CustomerBootstrapData by populating the customer model corresponding to the given customer and power type. |
void |
handleMessage(org.powertac.common.MarketTransaction tx)
Receives a new MarketTransaction. |
void |
handleMessage(org.powertac.common.TariffTransaction ttx)
Handles a TariffTransaction. |
void |
handleMessage(org.powertac.common.msg.TimeslotComplete tc)
TimeslotComplete is the last message sent in each timeslot. |
void |
handleMessage(org.powertac.common.WeatherReport report)
Receives a new WeatherReport. |
String |
initialize(org.powertac.common.Competition competition,
List<String> completedInits)
Called by initialization service once at the beginning of each game. |
void |
receiveBrokerMessage(Object msg)
Incoming messages for brokers include: TariffTransaction tells us about customer subscription activity and power usage, MarketPosition tells us how much power we have bought or sold in a given timeslot, TimeslotComplete that tell us it's time to send in our bids/asks along with a number of other message types that we can safely ignore. |
void |
setBuyLimitPriceMax(double buyLimitPriceMax)
|
void |
setBuyLimitPriceMin(double buyLimitPriceMin)
|
void |
setConsumptionRate(double defaultConsumptionRate)
|
void |
setDefaults()
|
void |
setInitialBidKWh(double initialBidKWh)
|
void |
setProductionRate(double defaultProductionRate)
|
void |
setSellLimitPriceMax(double sellLimitPriceMax)
|
void |
setSellLimitPriceMin(double sellLimitPriceMin)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultBrokerService()
| Method Detail |
|---|
public void setDefaults()
setDefaults in interface org.powertac.common.interfaces.InitializationService
public String initialize(org.powertac.common.Competition competition,
List<String> completedInits)
initialize in interface org.powertac.common.interfaces.InitializationServicepublic org.powertac.common.Broker createBroker(String username)
public org.powertac.du.DefaultBrokerService.LocalBroker getFace()
public void activate()
public void receiveBrokerMessage(Object msg)
public void handleMessage(org.powertac.common.TariffTransaction ttx)
public void handleMessage(org.powertac.common.WeatherReport report)
public void handleMessage(org.powertac.common.MarketTransaction tx)
public void handleMessage(org.powertac.common.msg.CustomerBootstrapData cbd)
public void handleMessage(org.powertac.common.CashPosition cp)
public void handleMessage(org.powertac.common.msg.TimeslotComplete tc)
public List<Object> collectBootstrapData(int maxTimeslots)
collectBootstrapData in interface org.powertac.common.interfaces.BootstrapDataCollectorpublic double getConsumptionRate()
@ConfigurableValue(valueType="Double",
description="Fixed price/kwh for default consumption tariff")
public void setConsumptionRate(double defaultConsumptionRate)
public double getProductionRate()
@ConfigurableValue(valueType="Double",
description="Fixed price/kwh for default production tariff")
public void setProductionRate(double defaultProductionRate)
public double getInitialBidKWh()
@ConfigurableValue(valueType="Double",
description="Quantity to buy in day-ahead market before seeing actual customer data")
public void setInitialBidKWh(double initialBidKWh)
public double getBuyLimitPriceMax()
@ConfigurableValue(valueType="Double",
description="Initial limit price/mwh for bids in day-ahead market")
public void setBuyLimitPriceMax(double buyLimitPriceMax)
public double getBuyLimitPriceMin()
@ConfigurableValue(valueType="Double",
description="Final limit price/mwh for bids in day-ahead market")
public void setBuyLimitPriceMin(double buyLimitPriceMin)
public double getSellLimitPriceMax()
@ConfigurableValue(valueType="Double",
description="Initial limit price/mwh for asks in day-ahead market")
public void setSellLimitPriceMax(double sellLimitPriceMax)
public double getSellLimitPriceMin()
@ConfigurableValue(valueType="Double",
description="Final limit price/mwh for asks in day-ahead market")
public void setSellLimitPriceMin(double sellLimitPriceMin)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||