/** * Configures this instance from the given configuration service. */ public void configure (ServerConfiguration configSource) { serverConfiguration = configSource; configSource.configureMe(this); }
@Override public String initialize (Competition competition, List<String> completedInits) { serverConfig.configureMe(this); if (remoteVisualizer) { // set up the output queue log.info("Remote visualizer on queue " + visualizerQueueName); jmsManagementService.createQueue(visualizerQueueName); } return "VisualizerProxy"; }
/** * Configures this singleton when it's needed. Not called during instance * creation to allow testing without a full Spring setup. */ public void configure () { if (null == serverConfiguration) { serverConfiguration = (ServerConfiguration) SpringApplicationContext.getBean("serverPropertiesService"); } if (null == serverConfiguration) { // should not happen outside of testing log.warn("Cannot find serverPropertiesService"); } else { serverConfiguration.configureMe(this); } }
/** * Configures this singleton when it's needed. Not called during instance * creation to allow testing without a full Spring setup. This version is * Deprecated! Please use configure(ServerConfiguration) instead. */ @Deprecated public void configure () { if (null == serverConfiguration) { serverConfiguration = (ServerConfiguration) SpringApplicationContext.getBean("serverPropertiesService"); } if (null == serverConfiguration) { // should not happen outside of testing log.warn("Cannot find serverPropertiesService"); } else { serverConfiguration.configureMe(this); } }
/** * Creates the instance and sets the reference to the timeService. */ public static void initialize (CompetitionControlService competitionControl, TimeService timeService) { instance = new SimulationClockControl(competitionControl, timeService); ServerConfiguration serverConfig = (ServerConfiguration) SpringApplicationContext.getBean("serverPropertiesService"); serverConfig.configureMe(instance); }
/** * Computes actual distribution and balancing costs by random selection */ @Override public String initialize (Competition competition, List<String> completedInits) { super.init(); balancingCost = null; serverProps.configureMe(this); if (null == balancingCost) balancingCost = 0D; log.info("Configured BM: balancing cost = " + balancingCost + ", (pPlus',pMinus') = (" + pPlusPrime + "," + pMinusPrime + ")"); serverProps.publishConfiguration(this); return "BalancingMarket"; }
return; serverConfiguration.configureMe(this); structures = new HashMap<>();
@Override public String initialize (Competition competition, List<String> completedInits) { incoming.clear(); serverProps.configureMe(this); brokerProxyService.registerBrokerMessageListener(this, Order.class); super.init(); serverProps.publishConfiguration(this); return "Auctioneer"; }
/** * 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"; }
public void start () { // pull down configuration - this will later change when configuration // available from web-app serverPropertiesService.configureMe(this); if (isServingJms()) { startProvider(); } initializeClientInterface(); }
@Override public String initialize (Competition competition, List<String> completedInits) { pendingTransactions.clear(); pendingMarketTransactions.clear(); super.init(); bankInterest = null; serverProps.configureMe(this); RandomSeed random = randomSeedService.getRandomSeed("AccountingService", 0l, "interest"); if (bankInterest == null) { // interest will be non-null in case it was overridden in the config bankInterest = (minInterest + (random.nextDouble() * (maxInterest - minInterest))); log.info("bank interest: " + bankInterest); } serverProps.publishConfiguration(this); return "AccountingService"; }
@Override public String initialize (Competition competition, List<String> completedInits) { super.init(); aheadDays = new CopyOnWriteArrayList<DateTime>(); serverProps.configureMe(this); weatherReqInterval = Math.min(24, weatherReqInterval); simulationBaseTime = competition.getSimulationBaseTime().toDateTime(); if (weatherData != null && (weatherData.endsWith(".xml") || weatherData.endsWith(".state"))) { log.info("read from file in blocking mode"); blocking = true; } if (!blocking) { DateTime dateTime = timeslotRepo.currentTimeslot().getStartTime(); // Get the first 3 days of weather, blocking! for (int i = 0; i < daysAhead; i++) { WeatherRequester weatherRequester = new WeatherRequester(dateTime); weatherRequester.run(); dateTime = dateTime.plusDays(1); } } return "WeatherService"; }
lastRevokeProcess = new Instant(0l); serverProps.configureMe(this);
int seedId = 0; serverConfig.configureMe(this); serverConfig.configureMe(buyer); brokerRepo.add(buyer); gencos.add(buyer); serverConfig.configureMe(cpGenco); cpGenco.init(brokerProxyService, seedId++, randomSeedRepo, timeslotRepo); brokerRepo.add(cpGenco); serverConfig.configureMe(misoBuyer); misoBuyer.init(brokerProxyService, seedId++, this); brokerRepo.add(misoBuyer);
distributionFee = null; serverProps.configureMe(this);
serverPropertiesService.configureMe(this);