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 void
activate(org.joda.time.Instant now, int phase)
This method gets called once during each timeslot.CustomerRepo
getCustomerRepo()
Returns a reference to a CustomerRepoRandomSeedRepo
getRandomSeedRepo()
Returns a reference to a RandomSeedRepoServerConfiguration
getServerConfiguration()
Returns a reference to a ServerConfiguration serviceTariffMarket
getTariffMarket()
Returns a reference to the TariffMarketTariffRepo
getTariffRepo()
Returns a reference to a TariffRepoTariffSubscriptionRepo
getTariffSubscriptionRepo()
Returns a reference to a TariffSubscriptionRepoTimeService
getTimeService()
Returns a reference to the TimeServiceTimeslotRepo
getTimeslotRepo()
Returns a reference to a TimeslotRepoWeatherForecastRepo
getWeatherForecastRepo()
WeatherReportRepo
getWeatherReportRepo()
Returns a reference to a WeatherReportRepoString
initialize(Competition competition, List<String> completedInits)
This is called once at the beginning of each game.void
publishNewTariffs(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:
initialize
in interfaceInitializationService
-
getTimeService
public TimeService getTimeService()
Description copied from interface:CustomerServiceAccessor
Returns a reference to the TimeService- Specified by:
getTimeService
in interfaceCustomerServiceAccessor
-
getCustomerRepo
public CustomerRepo getCustomerRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a CustomerRepo- Specified by:
getCustomerRepo
in interfaceCustomerServiceAccessor
-
getTariffRepo
public TariffRepo getTariffRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a TariffRepo- Specified by:
getTariffRepo
in interfaceCustomerServiceAccessor
-
getTimeslotRepo
public TimeslotRepo getTimeslotRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a TimeslotRepo- Specified by:
getTimeslotRepo
in interfaceCustomerServiceAccessor
-
getRandomSeedRepo
public RandomSeedRepo getRandomSeedRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a RandomSeedRepo- Specified by:
getRandomSeedRepo
in interfaceCustomerServiceAccessor
-
getTariffSubscriptionRepo
public TariffSubscriptionRepo getTariffSubscriptionRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a TariffSubscriptionRepo- Specified by:
getTariffSubscriptionRepo
in interfaceCustomerServiceAccessor
-
getTariffMarket
public TariffMarket getTariffMarket()
Description copied from interface:CustomerServiceAccessor
Returns a reference to the TariffMarket- Specified by:
getTariffMarket
in interfaceCustomerServiceAccessor
-
getWeatherReportRepo
public WeatherReportRepo getWeatherReportRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a WeatherReportRepo- Specified by:
getWeatherReportRepo
in interfaceCustomerServiceAccessor
-
getWeatherForecastRepo
public WeatherForecastRepo getWeatherForecastRepo()
-
publishNewTariffs
public void publishNewTariffs(List<Tariff> tariffs)
Description copied from interface:NewTariffListener
Called periodically with a list of newly-published Tariffs- Specified by:
publishNewTariffs
in interfaceNewTariffListener
-
activate
public void activate(org.joda.time.Instant now, int phase)
Description copied from class:TimeslotPhaseProcessor
This 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:
activate
in classTimeslotPhaseProcessor
-
getServerConfiguration
public ServerConfiguration getServerConfiguration()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a ServerConfiguration service- Specified by:
getServerConfiguration
in interfaceCustomerServiceAccessor
-
-