/** * Signals that the clock is paused due to server overrun. The pause * must be communicated to brokers. */ public void pause () { log.info("pause"); // create and post the pause message SimPause msg = new SimPause(); brokerProxyService.broadcastMessage(msg); }
brokerProxyService.broadcastMessage(competition); Properties published = configService.getPublishedConfiguration(); brokerProxyService.broadcastMessage(published); if (!bootstrapMode) { log.info("Published configuration: {}", published.toString()); brokerProxyService.broadcastMessage(makeTimeslotUpdate()); return true;
/** * Signals that the clock is resumed. Brokers must be informed of the new * start time in order to sync their own clocks. */ public void resume (long newStart) { log.info("resume"); // create and post the resume message SimResume msg = new SimResume(new Instant(newStart)); brokerProxyService.broadcastMessage(msg); }
private void broadcastWeatherReports () { WeatherReport report = null; try { report = weatherReportRepo.currentWeatherReport(); } catch (PowerTacException e) { log.error("Weather Service reports Weather Report Repo empty"); } if (report == null) { // In the event of an error return a default log.error("null weather-report for : " + timeslotRepo.currentSerialNumber() +" " + timeslotRepo.currentTimeslot()); brokerProxyService.broadcastMessage(new WeatherReport(timeslotRepo.currentSerialNumber(), 0.0, 0.0, 0.0, 0.0)); } else { brokerProxyService.broadcastMessage(report); } }
private void broadcastWeatherForecasts () { WeatherForecast forecast = null; try { forecast = weatherForecastRepo.currentWeatherForecast(); } catch (PowerTacException e) { log.error("Weather Service reports Weather Forecast Repo emtpy"); } if (forecast == null) { log.error("null weather-forecast for : " + timeslotRepo.currentSerialNumber() +" " + timeslotRepo.currentTimeslot()); // In the event of an error return a default List<WeatherForecastPrediction> currentPredictions = new ArrayList<WeatherForecastPrediction>(); for (int j = 1; j <= getForecastHorizon(); j++) { currentPredictions.add( new WeatherForecastPrediction(j, 0.0, 0.0, 0.0, 0.0)); } brokerProxyService.broadcastMessage(new WeatherForecast( timeslotRepo.currentSerialNumber(), currentPredictions)); } else { brokerProxyService.broadcastMessage(forecast); } }
/** * Shuts down the simulation and cleans up. */ @Override public void shutDown () { running = false; SimEnd endMsg = new SimEnd(); brokerProxyService.broadcastMessage(endMsg); simRunning = false; // need to wait for clock control stop before shutting down JMS provider if (clock != null) { clock.waitUntilStop(); } jmsManagementService.stop(); logService.stopLog(); }
brokerProxyService.broadcastMessage(msg); Date ended = new Date(); long elapsed = ended.getTime() - started.getTime();
brokerProxyService.broadcastMessage(startMsg);
@Override public void activate (Instant time, int phaseNumber) { log.info("Activate"); List<Broker> brokerList = brokerRepo.findRetailBrokers(); if (brokerList == null) { log.error("Failed to retrieve retail broker list"); return; } // create the BalanceReport to carry the total imbalance Timeslot current = timeslotRepo.currentTimeslot(); DoubleWrapper sum = makeDoubleWrapper(); // Run the balancing market // Transactions are posted to the Accounting Service and Brokers are // notified of balancing transactions balancingResults = balanceTimeslot(brokerList, sum); // Send the balance report BalanceReport report = new BalanceReport(current.getSerialNumber(), sum.getValue()); brokerProxyService.broadcastMessage(report); }
new DistributionReport(timeslotRepo.currentSerialNumber(), totalConsumption, totalProduction); brokerProxyService.broadcastMessage(distributionReport);
brokerProxyService.broadcastMessage(msg);
brokerProxyService.broadcastMessage(orderbook); if (totalMWh > 0.0) { ClearedTrade trade = new ClearedTrade(timeslot, totalMWh, clearingPrice, timeService.getCurrentTime()); log.info(trade.toString()); brokerProxyService.broadcastMessage(trade);
brokerProxyService.broadcastMessage(makeTimeslotUpdate()); return current.getSerialNumber();