/** * Initializes the instance. Called after configuration, and after * a call to setServices(). * TODO -- do we really want this here? */ public void initialize () { rs1 = service.getRandomSeedRepo().getRandomSeed(name, 0, "TariffChooser"); }
private void ensureSeeds () { if (null == evalSeed) { evalSeed = service.getRandomSeedRepo() .getRandomSeed(Battery.class.getName() + "-" + name, 0, "eval"); } }
private void ensureSeeds () { if (null == opSeed) { RandomSeedRepo repo = service.getRandomSeedRepo(); opSeed = repo.getRandomSeed( LiftTruck.class.getName() + "-" + name, 0, "model"); evalSeed = repo.getRandomSeed( LiftTruck.class.getName() + "-" + name, 0, "eval"); normal = new NormalDistribution(0.0, 1.0); normal.reseedRandomGenerator(opSeed.nextLong()); } }
private void ensureSeeds () { if (null == opSeed) { RandomSeedRepo repo = service.getRandomSeedRepo(); opSeed = repo.getRandomSeed( ColdStorage.class.getName() + "-" + name, 0, "model"); evalSeed = repo.getRandomSeed( ColdStorage.class.getName() + "-" + name, 0, "eval"); normal01 = new NormalDistribution(0.0, 1.0); normal01.reseedRandomGenerator(opSeed.nextLong()); } }
int days = Integer.parseInt(conf.getProperty("PublicVacationDuration")); gen = service.getRandomSeedRepo() .getRandomSeed(toString(), seed, "OfficeComplex Model" + seed);
int days = Integer.parseInt(conf.getProperty("PublicVacationDuration")); gen = service.getRandomSeedRepo() .getRandomSeed(toString(), seed, "Village Model" + seed);
/** * Hooks up data structures, creates EvCustomers and corresponding * CustomerInfo instances. */ @Override public void initialize() { super.initialize(); log.info("Initialize " + name); Map<String, Collection<?>> beans; generator = service.getRandomSeedRepo(). getRandomSeed("EvSocialClass-" + name, 1, "initialize"); Config.recycle(); config = Config.getInstance(); config.configure(service.getServerConfiguration()); beans = config.getBeans(); unpackBeans(beans); // Create and set up the customer instances evCustomers = new ArrayList<EvCustomer>(); if (null == customerAttributeList) { // boot session - dynamic configuration configureForBoot(beans); } else { // sim session - restore from boot record configureForSim(beans); } }
this.config = config; this.generator = service.getRandomSeedRepo().getRandomSeed(name, 1, "model"); setCurrentCapacity(0.5 * car.getMaxCapacity());