org.powertac.common.repo
Class WeatherForecastRepo

java.lang.Object
  extended by org.powertac.common.repo.WeatherForecastRepo
All Implemented Interfaces:
DomainRepo

@Repository
public class WeatherForecastRepo
extends Object
implements DomainRepo

Repository for WeatherReports. The weather reports are indexed by the timeslot that they are issued for. This allows them to be quickly accessed via a hashMap.

Author:
Erik Onarheim

Constructor Summary
WeatherForecastRepo()
          standard constructor
 
Method Summary
 void add(WeatherForecast weather)
          Adds a WeatherForecast to the repo
 List<WeatherForecast> allWeatherForecasts()
          Returns a list of all the issued weather forecast up to the currentTimeslot
 int count()
          Returns the number of WeatherForecasts that have been successfully created.
 WeatherForecast currentWeatherForecast()
          Returns the current WeatherForecast
 void recycle()
          Implementations must clear out the repository in preparation for a new simulation.
 void runOnce()
          Called by weather service to indicate weather exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeatherForecastRepo

public WeatherForecastRepo()
standard constructor

Method Detail

add

public void add(WeatherForecast weather)
Adds a WeatherForecast to the repo


currentWeatherForecast

public WeatherForecast currentWeatherForecast()
                                       throws PowerTacException
Returns the current WeatherForecast

Throws:
PowerTacException

allWeatherForecasts

public List<WeatherForecast> allWeatherForecasts()
Returns a list of all the issued weather forecast up to the currentTimeslot


count

public int count()
Returns the number of WeatherForecasts that have been successfully created.


runOnce

public void runOnce()
Called by weather service to indicate weather exists


recycle

public void recycle()
Description copied from interface: DomainRepo
Implementations must clear out the repository in preparation for a new simulation.

Specified by:
recycle in interface DomainRepo


Copyright © 2013. All Rights Reserved.