Class OfficeComplexCustomerService
- java.lang.Object
-
- org.powertac.common.interfaces.TimeslotPhaseProcessor
-
- org.powertac.officecomplexcustomer.OfficeComplexCustomerService
-
- All Implemented Interfaces:
CustomerServiceAccessor,InitializationService,NewTariffListener
@Service public class OfficeComplexCustomerService extends TimeslotPhaseProcessor implements NewTariffListener, InitializationService, CustomerServiceAccessor
Implements the Office Consumer Model. It creates Office Consumers that can subscribe to tariffs, evaluate them in order to choose the best one for its interests, shift their load in order to minimize their costs and many others. They contain different types of households with respect to the way they choose the tariffs and they shift their loads.- Version:
- 1.5, Date: 2.25.12
- Author:
- Antonios Chrysopoulos
-
-
Constructor Summary
Constructors Constructor Description OfficeComplexCustomerService()This is the constructor of the Office Consumer Service.
-
Method Summary
All 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.voidclearConfiguration()This function cleans the configuration files in case they have not been cleaned at the beginning of the gameList<CustomerInfo>generateCustomerInfoList()This function finds all the available Office Consumers in the competition and creates a list of their customerInfo.StringgetConfigFile1()Getter method for the first configuration fileCustomerRepogetCustomerRepo()Returns a reference to a CustomerRepoList<OfficeComplex>getOfficeComplexList()This function returns the list of the villages created at the beginning of the game by the serviceRandomSeedRepogetRandomSeedRepo()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)This function called once at the beginning of each game by the server initialization service.voidpublishNewTariffs(List<Tariff> tariffs)Called periodically with a list of newly-published TariffsvoidsetConfigFile1(String config)-
Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor
init, setTimeslotPhase
-
-
-
-
Method Detail
-
initialize
public String initialize(Competition competition, List<String> completedInits)
This function called once at the beginning of each game by the server initialization service. Here is where you do pre-game setup. This will read the server properties file to take the competition input variables needed (configuration files, days of competition), create a listener for our service, in order to get the new tariff, as well as create the household Consumers that will be running in the game.- Specified by:
initializein interfaceInitializationService
-
publishNewTariffs
public void publishNewTariffs(List<Tariff> tariffs)
Description copied from interface:NewTariffListenerCalled periodically with a list of newly-published Tariffs- Specified by:
publishNewTariffsin interfaceNewTariffListener
-
getConfigFile1
public String getConfigFile1()
Getter method for the first configuration file
-
setConfigFile1
@ConfigurableValue(valueType="String", description="first configuration file of the office complex customers") public void setConfigFile1(String config)
-
getOfficeComplexList
public List<OfficeComplex> getOfficeComplexList()
This function returns the list of the villages created at the beginning of the game by the service
-
clearConfiguration
public void clearConfiguration()
This function cleans the configuration files in case they have not been cleaned at the beginning of the game
-
generateCustomerInfoList
public List<CustomerInfo> generateCustomerInfoList()
This function finds all the available Office Consumers in the competition and creates a list of their customerInfo.- Returns:
- List
-
activate
public 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 classTimeslotPhaseProcessor
-
getCustomerRepo
public CustomerRepo getCustomerRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a CustomerRepo- Specified by:
getCustomerRepoin interfaceCustomerServiceAccessor
-
getRandomSeedRepo
public RandomSeedRepo getRandomSeedRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a RandomSeedRepo- Specified by:
getRandomSeedRepoin interfaceCustomerServiceAccessor
-
getTariffRepo
public TariffRepo getTariffRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a TariffRepo- Specified by:
getTariffRepoin interfaceCustomerServiceAccessor
-
getTariffSubscriptionRepo
public TariffSubscriptionRepo getTariffSubscriptionRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a TariffSubscriptionRepo- Specified by:
getTariffSubscriptionRepoin interfaceCustomerServiceAccessor
-
getTimeslotRepo
public TimeslotRepo getTimeslotRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a TimeslotRepo- Specified by:
getTimeslotRepoin interfaceCustomerServiceAccessor
-
getTimeService
public TimeService getTimeService()
Description copied from interface:CustomerServiceAccessorReturns a reference to the TimeService- Specified by:
getTimeServicein interfaceCustomerServiceAccessor
-
getWeatherReportRepo
public WeatherReportRepo getWeatherReportRepo()
Description copied from interface:CustomerServiceAccessorReturns a reference to a WeatherReportRepo- Specified by:
getWeatherReportRepoin interfaceCustomerServiceAccessor
-
getServerConfiguration
public ServerConfiguration getServerConfiguration()
Description copied from interface:CustomerServiceAccessorReturns a reference to a ServerConfiguration service- Specified by:
getServerConfigurationin interfaceCustomerServiceAccessor
-
getTariffMarket
public TariffMarket getTariffMarket()
Description copied from interface:CustomerServiceAccessorReturns a reference to the TariffMarket- Specified by:
getTariffMarketin interfaceCustomerServiceAccessor
-
-