public void init (BrokerProxy proxy, int seedId, ContextService service) { log.info("init(" + seedId + ") " + getUsername()); timeslotsOpen = Competition.currentCompetition().getTimeslotsOpen(); this.brokerProxyService = proxy; //this.service = service; this.timeslotRepo = (TimeslotRepo)service.getBean("timeslotRepo"); this.weatherReportRepo = (WeatherReportRepo)service.getBean("weatherReportRepo"); this.weatherForecastRepo = (WeatherForecastRepo)service.getBean("weatherForecastRepo"); RandomSeedRepo randomSeedRepo = (RandomSeedRepo)service.getBean("randomSeedRepo"); // set up the random generator this.tsSeed = randomSeedRepo.getRandomSeed(MisoBuyer.class.getName(), seedId, "ts"); // compute offsets for daily and weekly seasonal data int ts = timeslotRepo.currentSerialNumber(); timeslotOffset = ts; DateTime start = timeslotRepo.getDateTimeForIndex(ts); dailyOffset = start.getHourOfDay(); weeklyOffset = (start.getDayOfWeek() - 1) * 24 + dailyOffset; timeseries = new ComposedTS(); timeseries.initialize(ts); }