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 void
activate(org.joda.time.Instant time, int phaseNumber)
This method gets called once during each timeslot.void
clearConfiguration()
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.String
getConfigFile1()
Getter method for the first configuration fileCustomerRepo
getCustomerRepo()
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 serviceRandomSeedRepo
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 TimeslotRepoWeatherReportRepo
getWeatherReportRepo()
Returns a reference to a WeatherReportRepoString
initialize(Competition competition, List<String> completedInits)
This function called once at the beginning of each game by the server initialization service.void
publishNewTariffs(List<Tariff> tariffs)
Called periodically with a list of newly-published Tariffsvoid
setConfigFile1(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:
initialize
in interfaceInitializationService
-
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
-
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: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
-
getCustomerRepo
public CustomerRepo getCustomerRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a CustomerRepo- Specified by:
getCustomerRepo
in interfaceCustomerServiceAccessor
-
getRandomSeedRepo
public RandomSeedRepo getRandomSeedRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a RandomSeedRepo- Specified by:
getRandomSeedRepo
in interfaceCustomerServiceAccessor
-
getTariffRepo
public TariffRepo getTariffRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a TariffRepo- Specified by:
getTariffRepo
in interfaceCustomerServiceAccessor
-
getTariffSubscriptionRepo
public TariffSubscriptionRepo getTariffSubscriptionRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a TariffSubscriptionRepo- Specified by:
getTariffSubscriptionRepo
in interfaceCustomerServiceAccessor
-
getTimeslotRepo
public TimeslotRepo getTimeslotRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a TimeslotRepo- Specified by:
getTimeslotRepo
in interfaceCustomerServiceAccessor
-
getTimeService
public TimeService getTimeService()
Description copied from interface:CustomerServiceAccessor
Returns a reference to the TimeService- Specified by:
getTimeService
in interfaceCustomerServiceAccessor
-
getWeatherReportRepo
public WeatherReportRepo getWeatherReportRepo()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a WeatherReportRepo- Specified by:
getWeatherReportRepo
in interfaceCustomerServiceAccessor
-
getServerConfiguration
public ServerConfiguration getServerConfiguration()
Description copied from interface:CustomerServiceAccessor
Returns a reference to a ServerConfiguration service- Specified by:
getServerConfiguration
in interfaceCustomerServiceAccessor
-
getTariffMarket
public TariffMarket getTariffMarket()
Description copied from interface:CustomerServiceAccessor
Returns a reference to the TariffMarket- Specified by:
getTariffMarket
in interfaceCustomerServiceAccessor
-
-