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
Modifier and Type Method Description voidactivate(org.joda.time.Instant time, int phaseNumber)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()List<OfficeComplex>getOfficeComplexList()This function returns the list of the villages created at the beginning of the game by the serviceRandomSeedRepogetRandomSeedRepo()ServerConfigurationgetServerConfiguration()TariffMarketgetTariffMarket()TariffRepogetTariffRepo()TariffSubscriptionRepogetTariffSubscriptionRepo()TimeServicegetTimeService()TimeslotRepogetTimeslotRepo()WeatherReportRepogetWeatherReportRepo()Stringinitialize(Competition competition, List<String> completedInits)This function called once at the beginning of each game by the server initialization service.voidpublishNewTariffs(List<Tariff> tariffs)voidsetConfigFile1(String config)Methods inherited from class org.powertac.common.interfaces.TimeslotPhaseProcessor
init, setTimeslotPhase
-
Constructor Details
-
OfficeComplexCustomerService
public OfficeComplexCustomerService()This is the constructor of the Office Consumer Service.
-
-
Method Details
-
initialize
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
- Specified by:
publishNewTariffsin interfaceNewTariffListener
-
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
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
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)- Specified by:
activatein classTimeslotPhaseProcessor
-
getCustomerRepo
- Specified by:
getCustomerRepoin interfaceCustomerServiceAccessor
-
getRandomSeedRepo
- Specified by:
getRandomSeedRepoin interfaceCustomerServiceAccessor
-
getTariffRepo
- Specified by:
getTariffRepoin interfaceCustomerServiceAccessor
-
getTariffSubscriptionRepo
- Specified by:
getTariffSubscriptionRepoin interfaceCustomerServiceAccessor
-
getTimeslotRepo
- Specified by:
getTimeslotRepoin interfaceCustomerServiceAccessor
-
getTimeService
- Specified by:
getTimeServicein interfaceCustomerServiceAccessor
-
getWeatherReportRepo
- Specified by:
getWeatherReportRepoin interfaceCustomerServiceAccessor
-
getServerConfiguration
- Specified by:
getServerConfigurationin interfaceCustomerServiceAccessor
-
getTariffMarket
- Specified by:
getTariffMarketin interfaceCustomerServiceAccessor
-