Package org.powertac.common.repo
Class WeatherForecastRepo
- java.lang.Object
- 
- org.powertac.common.repo.WeatherForecastRepo
 
- 
- All Implemented Interfaces:
- DomainRepo
 
 @Service 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. The parameter maxForecastCount controls the number of old forecasts kept in memory.- Author:
- Erik Onarheim
 
- 
- 
Constructor SummaryConstructors Constructor Description WeatherForecastRepo()standard constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(WeatherForecast weather)Adds a WeatherForecast to the repoList<WeatherForecast>allWeatherForecasts()Returns a list of all the issued weather forecast up to the currentTimeslotintcount()Returns the number of WeatherForecasts that have been successfully created.WeatherForecastcurrentWeatherForecast()Returns the current WeatherForecastvoidrecycle()Implementations must clear out the repository in preparation for a new simulation.voidrunOnce()Called by weather service to indicate weather exists
 
- 
- 
- 
Method Detail- 
addpublic void add(WeatherForecast weather) Adds a WeatherForecast to the repo
 - 
currentWeatherForecastpublic WeatherForecast currentWeatherForecast() throws PowerTacException Returns the current WeatherForecast- Throws:
- PowerTacException
 
 - 
allWeatherForecastspublic List<WeatherForecast> allWeatherForecasts() Returns a list of all the issued weather forecast up to the currentTimeslot
 - 
countpublic int count() Returns the number of WeatherForecasts that have been successfully created.
 - 
runOncepublic void runOnce() Called by weather service to indicate weather exists
 - 
recyclepublic void recycle() Description copied from interface:DomainRepoImplementations must clear out the repository in preparation for a new simulation.- Specified by:
- recyclein interface- DomainRepo
 
 
- 
 
-