Package org.powertac.factoredcustomer
Class FactoredCustomerService
- java.lang.Object
-
- org.powertac.common.interfaces.TimeslotPhaseProcessor
-
- org.powertac.factoredcustomer.FactoredCustomerService
-
- All Implemented Interfaces:
CustomerServiceAccessor,InitializationService,NewTariffListener
@Service public class FactoredCustomerService extends TimeslotPhaseProcessor implements InitializationService, NewTariffListener, CustomerServiceAccessor
Key class that processes the configuration file and creates a collection of customers during the initialization process. It also delegates tariff selection callbacks and timeslot activation (i.e., capacity reporting) to the collection of customers.- Author:
- Prashant Reddy
-
-
Constructor Summary
Constructors Constructor Description FactoredCustomerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.joda.time.Instant now, int phase)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 TimeslotRepoWeatherForecastRepogetWeatherForecastRepo()WeatherReportRepogetWeatherReportRepo()Returns a reference to a WeatherReportRepoStringinitialize(Competition competition, List<String> completedInits)This is called once at the beginning of each game.voidpublishNewTariffs(List<Tariff> tariffs)Called periodically with a list of newly-published Tariffs-
Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor
init, setTimeslotPhase
-
-
-
-
Method Detail
-
initialize
public String initialize(Competition competition, List<String> completedInits)
This is called once at the beginning of each game.- Specified by:
initializein interfaceInitializationService
-
getTimeService
public TimeService getTimeService()
Description copied from interface:CustomerServiceAccessorReturns a reference to the TimeService- Specified by:
getTimeServicein interfaceCustomerServiceAccessor
-
getCustomerRepo
public CustomerRepo getCustomerRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a CustomerRepo- Specified by:
getCustomerRepoin interfaceCustomerServiceAccessor
-
getTariffRepo
public TariffRepo getTariffRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a TariffRepo- Specified by:
getTariffRepoin interfaceCustomerServiceAccessor
-
getTimeslotRepo
public TimeslotRepo getTimeslotRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a TimeslotRepo- Specified by:
getTimeslotRepoin interfaceCustomerServiceAccessor
-
getRandomSeedRepo
public RandomSeedRepo getRandomSeedRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a RandomSeedRepo- Specified by:
getRandomSeedRepoin interfaceCustomerServiceAccessor
-
getTariffSubscriptionRepo
public TariffSubscriptionRepo getTariffSubscriptionRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a TariffSubscriptionRepo- Specified by:
getTariffSubscriptionRepoin interfaceCustomerServiceAccessor
-
getTariffMarket
public TariffMarket getTariffMarket()
Description copied from interface:CustomerServiceAccessorReturns a reference to the TariffMarket- Specified by:
getTariffMarketin interfaceCustomerServiceAccessor
-
getWeatherReportRepo
public WeatherReportRepo getWeatherReportRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a WeatherReportRepo- Specified by:
getWeatherReportRepoin interfaceCustomerServiceAccessor
-
getWeatherForecastRepo
public WeatherForecastRepo getWeatherForecastRepo()
-
publishNewTariffs
public void publishNewTariffs(List<Tariff> tariffs)
Description copied from interface:NewTariffListenerCalled periodically with a list of newly-published Tariffs- Specified by:
publishNewTariffsin interfaceNewTariffListener
-
activate
public void activate(org.joda.time.Instant now, int phase)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 classTimeslotPhaseProcessor
-
getServerConfiguration
public ServerConfiguration getServerConfiguration()
Description copied from interface:CustomerServiceAccessorReturns a reference to a ServerConfiguration service- Specified by:
getServerConfigurationin interfaceCustomerServiceAccessor
-
-