Class MessageHandler

java.lang.Object
org.powertac.visualizer.service_ptac.MessageHandler

@Service
public class MessageHandler
extends Object
This is an implementation of the Initializable interface. It will be initialized upon startup and registered for handling Power TAC messages in case there are proper method signatures, e.g., "handleMessage(VizCompetition competition)". intended for the Visualizer.
Author:
Jurica Babic, Govert Buijs, Erik Kemperman
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      public void initialize()
    • handleMessage

      public void handleMessage​(Competition c)
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.SimPause sp)
      Receives the SimPause message, used to pause the clock. While the clock is paused, the broker needs to ignore the local clock.
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.SimResume sr)
      Receives the SimResume message, used to update the clock.
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.SimStart ss)
      Receives the SimStart message, used to start the clock. The server's clock offset is subtracted from the start time indicated by the server.
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.SimEnd se)
      Receives the SimEnd message, which ends the broker session.
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.TimeslotUpdate tu)
      Updates the sim clock on receipt of the TimeslotUpdate message, which should be the first to arrive in each timeslot.
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.CustomerBootstrapData cbd)
    • handleMessage

      public void handleMessage​(CashPosition cp)
      CashPosition is the last message sent by Accounting. This is normally when any broker would submit its bids, so that's when this VizBroker will do it.
    • handleMessage

      public void handleMessage​(TariffSpecification spec)
      Handles a TariffSpecification. These are sent by the server when new tariffs are published. If it's not ours, then it's a competitor's tariff. We keep track of competing tariffs locally, and we also store them in the tariffRepo.
    • handleMessage

      public void handleMessage​(TariffTransaction ttx)
      Handles a TariffTransaction. We only care about certain types: PRODUCE, CONSUME, SIGNUP, and WITHDRAW.
    • handleMessage

      public void handleMessage​(org.powertac.common.msg.TariffRevoke tr)
      Handles a TariffRevoke message from the server, indicating that some tariff has been revoked.
    • handleMessage

      public void handleMessage​(MarketTransaction mtx)
      Handles a wholesale MarketTransaction