Package org.powertac.customer
Class CustomerModelService
- java.lang.Object
- 
- org.powertac.common.interfaces.TimeslotPhaseProcessor
- 
- org.powertac.customer.CustomerModelService
 
 
- 
- All Implemented Interfaces:
- BootstrapState,- CustomerServiceAccessor,- InitializationService,- NewTariffListener
 
 @Service public class CustomerModelService extends TimeslotPhaseProcessor implements InitializationService, BootstrapState, NewTariffListener, CustomerServiceAccessor Manages a set of customer models. Each must be configurable as ConfigurableInstances. Each gets supplied a set of service interfaces. In each timeslot, each model has its step() method called. When tariffs are published, each has its evaluateTariffs() method called. At the end of a boot session, each has its bootstrap state saved to the boot record.- Author:
- John Collins
 
- 
- 
Constructor SummaryConstructors Constructor Description CustomerModelService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.joda.time.Instant time, int phaseNumber)This method gets called once during each timeslot.CustomerRepogetCustomerRepo()Returns a reference to a CustomerRepoRandomSeedRepogetRandomSeedRepo()Returns a reference to a RandomSeedRepoServerConfigurationgetServerConfiguration()Returns a reference to a ServerConfiguration serviceTariffMarketgetTariffMarket()Returns a reference to the TariffMarketTariffRepogetTariffRepo()Returns a reference to a TariffRepoTariffSubscriptionRepogetTariffSubscriptionRepo()Returns a reference to a TariffSubscriptionRepoTimeServicegetTimeService()Returns a reference to the TimeServiceTimeslotRepogetTimeslotRepo()Returns a reference to a TimeslotRepoWeatherReportRepogetWeatherReportRepo()Returns a reference to a WeatherReportRepoStringinitialize(Competition competition, List<String> completedInits)Initializes a plugin prior to the beginning of a game.voidpublishNewTariffs(List<Tariff> tariffs)Called periodically with a list of newly-published TariffsvoidsaveBootstrapState()Saves state at the conclusion of a bootstrap session as configuration items.- 
Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessorinit, setTimeslotPhase
 
- 
 
- 
- 
- 
Method Detail- 
initializepublic String initialize(Competition competition, List<String> completedInits) Description copied from interface:InitializationServiceInitializes a plugin prior to the beginning of a game. The completedInits parameter is the list of plugin role names that have been successfully initialized. If sequence dependencies are satisfied (or if there are no sequence dependencies), then an implementation must complete its pre-game initialization process and return its role name. If sequence dependencies are not satisfied, then an implementation must return null. It will be called again after additional successful initializations have been completed. If initialization is not possible, then returning the string 'fail' will cause the server to log an error and shut down. This will be helpful just in case the implementation also logs a detailed error message.- Specified by:
- initializein interface- InitializationService
 
 - 
activatepublic void activate(org.joda.time.Instant time, int phaseNumber)Description copied from class:TimeslotPhaseProcessorThis method gets called once during each timeslot. To get called, the module must first call the register(phaseNumber) method on CompetitionControl. The call will give the current simulation time and phase number in the arguments.- Specified by:
- activatein class- TimeslotPhaseProcessor
 
 - 
publishNewTariffspublic void publishNewTariffs(List<Tariff> tariffs) Description copied from interface:NewTariffListenerCalled periodically with a list of newly-published Tariffs- Specified by:
- publishNewTariffsin interface- NewTariffListener
 
 - 
saveBootstrapStatepublic void saveBootstrapState() Description copied from interface:BootstrapStateSaves state at the conclusion of a bootstrap session as configuration items. State can then be restored at the beginning of the sim session through the normal configuration process. The usual way to save state is to call ServerPropertiesService.saveBootstrapState(arg), where arg is either a single configurable object (configured with configureMe() or configureSingleton()), or a list of objects annotated withConfigurableInstance.- Specified by:
- saveBootstrapStatein interface- BootstrapState
 
 - 
getCustomerRepopublic CustomerRepo getCustomerRepo() Description copied from interface:CustomerServiceAccessorReturns a reference to a CustomerRepo- Specified by:
- getCustomerRepoin interface- CustomerServiceAccessor
 
 - 
getRandomSeedRepopublic RandomSeedRepo getRandomSeedRepo() Description copied from interface:CustomerServiceAccessorReturns a reference to a RandomSeedRepo- Specified by:
- getRandomSeedRepoin interface- CustomerServiceAccessor
 
 - 
getTariffRepopublic TariffRepo getTariffRepo() Description copied from interface:CustomerServiceAccessorReturns a reference to a TariffRepo- Specified by:
- getTariffRepoin interface- CustomerServiceAccessor
 
 - 
getTariffSubscriptionRepopublic TariffSubscriptionRepo getTariffSubscriptionRepo() Description copied from interface:CustomerServiceAccessorReturns a reference to a TariffSubscriptionRepo- Specified by:
- getTariffSubscriptionRepoin interface- CustomerServiceAccessor
 
 - 
getTimeslotRepopublic TimeslotRepo getTimeslotRepo() Description copied from interface:CustomerServiceAccessorReturns a reference to a TimeslotRepo- Specified by:
- getTimeslotRepoin interface- CustomerServiceAccessor
 
 - 
getTimeServicepublic TimeService getTimeService() Description copied from interface:CustomerServiceAccessorReturns a reference to the TimeService- Specified by:
- getTimeServicein interface- CustomerServiceAccessor
 
 - 
getWeatherReportRepopublic WeatherReportRepo getWeatherReportRepo() Description copied from interface:CustomerServiceAccessorReturns a reference to a WeatherReportRepo- Specified by:
- getWeatherReportRepoin interface- CustomerServiceAccessor
 
 - 
getServerConfigurationpublic ServerConfiguration getServerConfiguration() Description copied from interface:CustomerServiceAccessorReturns a reference to a ServerConfiguration service- Specified by:
- getServerConfigurationin interface- CustomerServiceAccessor
 
 - 
getTariffMarketpublic TariffMarket getTariffMarket() Description copied from interface:CustomerServiceAccessorReturns a reference to the TariffMarket- Specified by:
- getTariffMarketin interface- CustomerServiceAccessor
 
 
- 
 
-