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
    void activate​(int timeslotIndex)
    Compute needed quantities for each open timeslot, then submit orders for those quantities.
    double getMeanMarketPrice()
    Returns the mean price observed in the market during the bootstrap session.
    void handleMessage​(org.powertac.common.BalancingTransaction tx)
    Handles a BalancingTransaction message.
    void handleMessage​(org.powertac.common.CapacityTransaction dt)
    Handles a CapacityTransaction - a charge for contribution to overall peak demand over the recent past.
    void handleMessage​(org.powertac.common.ClearedTrade ct)
    Handles a ClearedTrade message - this is where you would want to keep track of market prices.
    void handleMessage​(org.powertac.common.Competition comp)
    Handles the Competition instance that arrives at beginning of game.
    void handleMessage​(org.powertac.common.DistributionTransaction dt)
    Handles a DistributionTransaction - charges for transporting power
    void handleMessage​(org.powertac.common.MarketPosition posn)
    Receives a MarketPosition message, representing our commitments on the wholesale market
    void handleMessage​(org.powertac.common.MarketTransaction tx)
    Receives a new MarketTransaction.
    void handleMessage​(org.powertac.common.msg.BalanceReport report)
    Receives a BalanceReport containing information about imbalance in the current timeslot.
    void handleMessage​(org.powertac.common.msg.MarketBootstrapData data)
    Receives a MarketBootstrapData message, reporting usage and prices for the bootstrap period.
    void handleMessage​(org.powertac.common.Orderbook orderbook)
    Receives market orderbooks.
    void handleMessage​(org.powertac.common.WeatherForecast forecast)
    Receives a new WeatherForecast.
    void handleMessage​(org.powertac.common.WeatherReport report)
    Receives a new WeatherReport.
    void initialize​(org.powertac.samplebroker.interfaces.BrokerContext broker)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • initialize

      public void initialize​(org.powertac.samplebroker.interfaces.BrokerContext broker)
      Specified by:
      initialize in interface org.powertac.samplebroker.interfaces.Initializable
    • getMeanMarketPrice

      public double getMeanMarketPrice()
      Returns the mean price observed in the market during the bootstrap session.
      Specified by:
      getMeanMarketPrice in interface MarketManager
    • 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:
      activate in interface org.powertac.samplebroker.interfaces.Activatable
      See Also:
      Activatable.activate(int)