|
|||||||||
| 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 TimeslotUpdate 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. |
org.powertac.du.DefaultBrokerService.LocalBroker |
getFace()
|
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.WeatherReport report)
Receives a new WeatherReport. |
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, TimeslotUpdate 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. |
| 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 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 List<Object> collectBootstrapData(int maxTimeslots)
collectBootstrapData in interface org.powertac.common.interfaces.BootstrapDataCollector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||