@Service public class DefaultBrokerService extends Object implements BootstrapDataCollector, InitializationService
| Constructor and Description |
|---|
DefaultBrokerService()
Default constructor, called once when the server starts, before
any application-specific initialization has been done.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
Broker |
createBroker(String username)
Creates the internal Broker instance that can receive messages intended
for local Brokers.
|
double |
getBuyLimitPriceMax() |
double |
getBuyLimitPriceMin() |
double |
getConsumptionRate() |
DefaultBroker |
getFace() |
double |
getInitialBidKWh() |
double |
getProductionRate() |
double |
getSellLimitPriceMax() |
double |
getSellLimitPriceMin() |
void |
handleMessage(org.powertac.common.msg.BrokerAccept ba)
Handles the BrokerAccept message for completeness
|
void |
handleMessage(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(MarketTransaction tx)
Receives a new MarketTransaction.
|
void |
handleMessage(TariffTransaction ttx)
Handles a TariffTransaction.
|
void |
handleMessage(org.powertac.common.msg.TimeslotComplete tc)
TimeslotComplete is the last message sent in each timeslot.
|
void |
handleMessage(WeatherReport report)
Receives a new WeatherReport.
|
String |
initialize(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 |
setInitialBidKWh(double initialBidKWh) |
void |
setProductionRate(double defaultProductionRate) |
void |
setSellLimitPriceMax(double sellLimitPriceMax) |
void |
setSellLimitPriceMin(double sellLimitPriceMin) |
public DefaultBrokerService()
public String initialize(Competition competition, List<String> completedInits)
initialize in interface InitializationServicepublic Broker createBroker(String username)
public DefaultBroker getFace()
public void activate()
public void receiveBrokerMessage(Object msg)
public void handleMessage(org.powertac.common.msg.BrokerAccept ba)
public void handleMessage(TariffTransaction ttx)
public void handleMessage(WeatherReport report)
public void handleMessage(MarketTransaction tx)
public void handleMessage(org.powertac.common.msg.CustomerBootstrapData cbd)
public void handleMessage(CashPosition cp)
public void handleMessage(org.powertac.common.msg.TimeslotComplete tc)
public List<Object> collectBootstrapData(int maxTimeslots)
collectBootstrapData in interface 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)
Copyright © 2019 Power TAC. All rights reserved.