Class MarketForecaster

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MarketForecaster.Products
      Products of MarketForecasters
      • Nested classes/interfaces inherited from class de.dlr.gitlab.fame.agent.Agent

        de.dlr.gitlab.fame.agent.Agent.WarmUpStatus
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected TreeMap<de.dlr.gitlab.fame.time.TimeStamp,​MarketClearingResult> calculatedForecastContainer
      contains all previously calculated forecasts with their associated time
      protected int forecastPeriodInHours
      maximum number of future hours to provide forecasts for
      protected de.dlr.gitlab.fame.time.TimeSpan forecastRequestOffset
      offset in seconds of the MarketForecaster to send out its forecast requests to associated traders - must match the associated times -1 in the contracts with the traders
      protected MarketClearing marketClearing
      the algorithm used to clear the market
      • Fields inherited from class de.dlr.gitlab.fame.agent.Agent

        contractManager, ERR_MESSAGES_MISSING, ERR_NO_ACTION, ERR_UNHANDLED_MESSAGE, INFO_NO_FOLLOW_UP, LOG_EXECUTION, logger
    • Constructor Summary

      Constructors 
      Constructor Description
      MarketForecaster​(de.dlr.gitlab.fame.agent.input.DataProvider dataProvider)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected MarketClearingResult getResultForRequestedTime​(de.dlr.gitlab.fame.time.TimeStamp requestedTime)
      Returns stored clearing result for the given time - or throws an Exception if no result is stored
      protected void saveNextForecast()
      writes out the nearest upcoming forecast after current time
      protected TreeMap<de.dlr.gitlab.fame.time.TimeStamp,​ArrayList<de.dlr.gitlab.fame.communication.message.Message>> sortMessagesByBidTimeStamp​(ArrayList<de.dlr.gitlab.fame.communication.message.Message> messages)
      Groups given messages by their targeted time of delivery into an ordered Map
      • Methods inherited from class de.dlr.gitlab.fame.agent.Agent

        addContract, call, closeChannel, executeActions, executeWarmUp, fulfilNext, fulfilNext, getId, getNextRandomNumberGenerator, getPostOffice, handleMessage, now, openChannel, publish, receive, sendMessageTo, sendMessageTo, store, store, toString, warmUp
    • Field Detail

      • forecastPeriodInHours

        protected final int forecastPeriodInHours
        maximum number of future hours to provide forecasts for
      • forecastRequestOffset

        protected final de.dlr.gitlab.fame.time.TimeSpan forecastRequestOffset
        offset in seconds of the MarketForecaster to send out its forecast requests to associated traders - must match the associated times -1 in the contracts with the traders
      • marketClearing

        protected final MarketClearing marketClearing
        the algorithm used to clear the market
      • calculatedForecastContainer

        protected final TreeMap<de.dlr.gitlab.fame.time.TimeStamp,​MarketClearingResult> calculatedForecastContainer
        contains all previously calculated forecasts with their associated time
    • Constructor Detail

      • MarketForecaster

        public MarketForecaster​(de.dlr.gitlab.fame.agent.input.DataProvider dataProvider)
                         throws de.dlr.gitlab.fame.agent.input.ParameterData.MissingDataException
        Parameters:
        dataProvider - provides input from config file
        Throws:
        de.dlr.gitlab.fame.agent.input.ParameterData.MissingDataException - if any required data is not provided
    • Method Detail

      • sortMessagesByBidTimeStamp

        protected TreeMap<de.dlr.gitlab.fame.time.TimeStamp,​ArrayList<de.dlr.gitlab.fame.communication.message.Message>> sortMessagesByBidTimeStamp​(ArrayList<de.dlr.gitlab.fame.communication.message.Message> messages)
        Groups given messages by their targeted time of delivery into an ordered Map
        Parameters:
        messages - to group by
        Returns:
        a Map of Messages sorted by the TimeStamp their contained BidData are valid at
      • getResultForRequestedTime

        protected MarketClearingResult getResultForRequestedTime​(de.dlr.gitlab.fame.time.TimeStamp requestedTime)
        Returns stored clearing result for the given time - or throws an Exception if no result is stored
        Parameters:
        requestedTime - to fetch market clearing result for
        Returns:
        the result stored for the requested time
      • saveNextForecast

        protected void saveNextForecast()
        writes out the nearest upcoming forecast after current time