/** * 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. */ @Override public String initialize (Competition competition, List<String> completedInits) { if (!completedInits.contains("DefaultBroker") || !completedInits.contains("TariffMarket")) return null; super.init(); tariffMarketService.registerNewTariffListener(this); configuration = new Properties(); villageList = new ArrayList<Village>(); serverPropertiesService.configureMe(this); if (configFile1 == null) { log.info("No Config File for VillageType1 Taken"); configFile1 = "VillageDefault.properties"; } addVillages(configFile1, "1"); return "HouseholdCustomer"; }
/** * 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. */ @Override public String initialize (Competition competition, List<String> completedInits) { if (!completedInits.contains("DefaultBroker") || !completedInits.contains("TariffMarket")) return null; super.init(); configuration = new Properties(); officeComplexList = new ArrayList<OfficeComplex>(); tariffMarketService.registerNewTariffListener(this); serverPropertiesService.configureMe(this); //tariffMarketService.registerNewTariffListener(this); if (configFile1 == null) { log.info("No Config File for OfficeComplexType1 Taken"); configFile1 = "OfficeComplexDefault.properties"; } addOfficeComplexes(configFile1, "1"); return "OfficeComplexCustomer"; }
customerFactory = new CustomerFactory(); newTariffs = false; tariffMarketService.registerNewTariffListener(this);