Package org.powertac.samplebroker
Class MarketManagerService
java.lang.Object
org.powertac.samplebroker.MarketManagerService
- All Implemented Interfaces:
org.powertac.samplebroker.interfaces.Activatable,org.powertac.samplebroker.interfaces.Initializable,MarketManager
@Service public class MarketManagerService extends Object implements MarketManager, org.powertac.samplebroker.interfaces.Initializable, org.powertac.samplebroker.interfaces.Activatable
Handles market interactions on behalf of the broker.
- Author:
- John Collins
-
Constructor Summary
Constructors Constructor Description MarketManagerService() -
Method Summary
Modifier and Type Method Description voidactivate(int timeslotIndex)Compute needed quantities for each open timeslot, then submit orders for those quantities.doublegetMeanMarketPrice()Returns the mean price observed in the market during the bootstrap session.voidhandleMessage(org.powertac.common.BalancingTransaction tx)Handles a BalancingTransaction message.voidhandleMessage(org.powertac.common.CapacityTransaction dt)Handles a CapacityTransaction - a charge for contribution to overall peak demand over the recent past.voidhandleMessage(org.powertac.common.ClearedTrade ct)Handles a ClearedTrade message - this is where you would want to keep track of market prices.voidhandleMessage(org.powertac.common.Competition comp)Handles the Competition instance that arrives at beginning of game.voidhandleMessage(org.powertac.common.DistributionTransaction dt)Handles a DistributionTransaction - charges for transporting powervoidhandleMessage(org.powertac.common.MarketPosition posn)Receives a MarketPosition message, representing our commitments on the wholesale marketvoidhandleMessage(org.powertac.common.MarketTransaction tx)Receives a new MarketTransaction.voidhandleMessage(org.powertac.common.msg.BalanceReport report)Receives a BalanceReport containing information about imbalance in the current timeslot.voidhandleMessage(org.powertac.common.msg.MarketBootstrapData data)Receives a MarketBootstrapData message, reporting usage and prices for the bootstrap period.voidhandleMessage(org.powertac.common.Orderbook orderbook)Receives market orderbooks.voidhandleMessage(org.powertac.common.WeatherForecast forecast)Receives a new WeatherForecast.voidhandleMessage(org.powertac.common.WeatherReport report)Receives a new WeatherReport.voidinitialize(org.powertac.samplebroker.interfaces.BrokerContext broker)
-
Constructor Details
-
MarketManagerService
public MarketManagerService()
-
-
Method Details
-
initialize
public void initialize(org.powertac.samplebroker.interfaces.BrokerContext broker)- Specified by:
initializein interfaceorg.powertac.samplebroker.interfaces.Initializable
-
getMeanMarketPrice
public double getMeanMarketPrice()Returns the mean price observed in the market during the bootstrap session.- Specified by:
getMeanMarketPricein interfaceMarketManager
-
handleMessage
public void handleMessage(org.powertac.common.Competition comp)Handles the Competition instance that arrives at beginning of game. Here we capture minimum order size to avoid running into the limit and generating unhelpful error messages. -
handleMessage
public void handleMessage(org.powertac.common.BalancingTransaction tx)Handles a BalancingTransaction message. -
handleMessage
public void handleMessage(org.powertac.common.ClearedTrade ct)Handles a ClearedTrade message - this is where you would want to keep track of market prices. -
handleMessage
public void handleMessage(org.powertac.common.DistributionTransaction dt)Handles a DistributionTransaction - charges for transporting power -
handleMessage
public void handleMessage(org.powertac.common.CapacityTransaction dt)Handles a CapacityTransaction - a charge for contribution to overall peak demand over the recent past. -
handleMessage
public void handleMessage(org.powertac.common.msg.MarketBootstrapData data)Receives a MarketBootstrapData message, reporting usage and prices for the bootstrap period. We record the overall weighted mean price, as well as the mean price and usage for a week. -
handleMessage
public void handleMessage(org.powertac.common.MarketPosition posn)Receives a MarketPosition message, representing our commitments on the wholesale market -
handleMessage
public void handleMessage(org.powertac.common.MarketTransaction tx)Receives a new MarketTransaction. We look to see whether an order we have placed has cleared. -
handleMessage
public void handleMessage(org.powertac.common.Orderbook orderbook)Receives market orderbooks. These list un-cleared bids and asks, from which a broker can construct approximate supply and demand curves for the following timeslot. -
handleMessage
public void handleMessage(org.powertac.common.WeatherForecast forecast)Receives a new WeatherForecast. -
handleMessage
public void handleMessage(org.powertac.common.WeatherReport report)Receives a new WeatherReport. -
handleMessage
public void handleMessage(org.powertac.common.msg.BalanceReport report)Receives a BalanceReport containing information about imbalance in the current timeslot. -
activate
public void activate(int timeslotIndex)Compute needed quantities for each open timeslot, then submit orders for those quantities.- Specified by:
activatein interfaceorg.powertac.samplebroker.interfaces.Activatable- See Also:
Activatable.activate(int)
-