void initialize (int ts) { // set up the ring buffer ring = new double[timeslotsOpen]; // set up the white noise generator lastWalk = tsSeed.nextGaussian() * walkSd; lastSmooth = lastWalk; }
double generateValue (int ts) { // retrieve daily value, add daily noise double dv = getDailyValue(ts) + tsSeed.nextGaussian() * dailySd; // retrieve weekly value, add weekly noise double wv = getWeeklyValue(ts) + tsSeed.nextGaussian() * weeklySd; // run a step of the random walk, return sum lastWalk = (1.0 - walkz) * lastWalk + tsSeed.nextGaussian() * walkSd; lastSmooth = walkAlpha * lastWalk + (1.0 - walkAlpha) * lastSmooth; double result = mean + dv + wv + lastSmooth; log.debug("Demand ts {}: {}", ts, result); return result; }
@Override public void refresh (Properties conf) { // Renew Variables double leisureDurationMean = Double.parseDouble(conf.getProperty("LeisureDurationMean")); double leisureDurationDev = Double.parseDouble(conf.getProperty("LeisureDurationDev")); double MPLeisure = Double.parseDouble(conf.getProperty("MPLeisure")); double vacationAbsence = Double.parseDouble(conf.getProperty("VacationAbsence")); int x = (int) (gen.nextGaussian() + MPLeisure); leisureDuration = (int) (leisureDurationDev * gen.nextGaussian() + leisureDurationMean); leisureVector = createLeisureVector(x); for (int i = 0; i < VillageConstants.DAYS_OF_WEEK; i++) { fillDailyRoutine(i, vacationAbsence); weeklyRoutine.add(dailyRoutine); } } }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " SpaceHeater"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = Double.parseDouble(conf.getProperty("SpaceHeaterSaturation")); operationPercentage = Double.parseDouble(conf.getProperty("SpaceHeaterPercentage")); temperatureThreshold = (int) (VillageConstants.SPACE_HEATER_TEMPERATURE_VARIANCE * gen.nextGaussian() + VillageConstants.SPACE_HEATER_TEMPERATURE_MEAN); power = (int) (VillageConstants.SPACE_HEATER_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.SPACE_HEATER_POWER_MEAN); cycleDuration = VillageConstants.SPACE_HEATER_DURATION_CYCLE; }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " Stove"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = Double.parseDouble(conf.getProperty("StoveSaturation")); power = (int) (VillageConstants.STOVE_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.STOVE_POWER_MEAN); cycleDuration = VillageConstants.STOVE_DURATION_CYCLE; times = Integer.parseInt(conf.getProperty("StoveDailyTimes")); }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " Computers"; saturation = Double.parseDouble(conf.getProperty("ComputersSaturation")); randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.COMPUTERS_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.COMPUTERS_POWER_MEAN); cycleDuration = OfficeComplexConstants.COMPUTERS_DURATION_CYCLE; operationPercentage = Double.parseDouble(conf.getProperty("ComputersWorking")); }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " Refrigerator"; saturation = Double.parseDouble(conf.getProperty("RefrigeratorSaturation")); randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.REFRIGERATOR_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.REFRIGERATOR_POWER_MEAN); cycleDuration = OfficeComplexConstants.REFRIGERATOR_DURATION_CYCLE; }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " CirculationPump"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = Double.parseDouble(conf.getProperty("CirculationPumpSaturation")); operationPercentage = Double.parseDouble(conf.getProperty("CirculationPumpPercentage")); power = (int) (VillageConstants.CIRCULATION_PUMP_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.CIRCULATION_PUMP_POWER_MEAN); cycleDuration = VillageConstants.CIRCULATION_PUMP_DURATION_CYCLE; }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " Refrigerator"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = Double.parseDouble(conf.getProperty("RefrigeratorSaturation")); power = (int) (VillageConstants.REFRIGERATOR_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.REFRIGERATOR_POWER_MEAN); cycleDuration = VillageConstants.REFRIGERATOR_DURATION_CYCLE; }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " Dryer"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = Double.parseDouble(conf.getProperty("DryerSaturation")); power = (int) (VillageConstants.DRYER_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.DRYER_POWER_MEAN); cycleDuration = VillageConstants.DRYER_DURATION_CYCLE; }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " Freezer"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = Double.parseDouble(conf.getProperty("FreezerSaturation")); power = (int) (VillageConstants.FREEZER_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.FREEZER_POWER_MEAN); cycleDuration = VillageConstants.FREEZER_DURATION_CYCLE; }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " CoffeeMachine"; saturation = Double.parseDouble(conf.getProperty("RefrigeratorSaturation")); randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.COFFEE_MACHINE_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.COFFEE_MACHINE_POWER_MEAN); cycleDuration = OfficeComplexConstants.COFFEE_MACHINE_DURATION_CYCLE; standByPower = (int) (power / (cycleDuration - 1)); }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " Vending Machine"; saturation = Double.parseDouble(conf.getProperty("VendingMachineSaturation")); randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.VENDING_MACHINE_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.VENDING_MACHINE_POWER_MEAN); cycleDuration = OfficeComplexConstants.VENDING_MACHINE_DURATION_CYCLE; }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " ConsumerElectronics"; saturation = 1; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.CONSUMER_ELECTRONICS_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.CONSUMER_ELECTRONICS_POWER_MEAN); cycleDuration = OfficeComplexConstants.CONSUMER_ELECTRONICS_DURATION_CYCLE; operationPercentage = Double.parseDouble(conf.getProperty("ConsumerElectronicsWorking")); }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " ICT"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = 1; power = (int) (VillageConstants.ICT_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.ICT_POWER_MEAN); cycleDuration = VillageConstants.ICT_DURATION_CYCLE; times = Integer.parseInt(conf.getProperty("ICTDailyTimes")) + applianceOf.getMembers().size(); }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " ICT"; saturation = 1; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.ICT_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.ICT_POWER_MEAN); cycleDuration = OfficeComplexConstants.ICT_DURATION_CYCLE; times = Integer.parseInt(conf.getProperty("ICTDailyTimes")) + (int) (applianceOf.getMembers().size() / OfficeComplexConstants.PERSONS); }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " Others"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = 1; power = (int) (VillageConstants.OTHERS_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.OTHERS_POWER_MEAN); cycleDuration = VillageConstants.OTHERS_DURATION_CYCLE; times = Integer.parseInt(conf.getProperty("OthersDailyTimes")) + applianceOf.getMembers().size(); }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " ConsumerElectronics"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = 1; power = (int) (VillageConstants.CONSUMER_ELECTRONICS_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.CONSUMER_ELECTRONICS_POWER_MEAN); cycleDuration = VillageConstants.CONSUMER_ELECTRONICS_DURATION_CYCLE; times = Integer.parseInt(conf.getProperty("ConsumerElectronicsDailyTimes")) + applianceOf.getMembers().size(); }
@Override public void initialize (String household, Properties conf, int seed) { // Filling the base variables name = household + " Lights"; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); saturation = 1; power = (int) (VillageConstants.LIGHTS_POWER_VARIANCE * gen.nextGaussian() + VillageConstants.LIGHTS_POWER_MEAN); cycleDuration = VillageConstants.LIGHTS_DURATION_CYCLE; }
@Override public void initialize (String office, Properties conf, int seed) { // Filling the base variables name = office + " Lights"; saturation = 1; randomSeedRepo = (RandomSeedRepo) SpringApplicationContext.getBean("randomSeedRepo"); gen = randomSeedRepo.getRandomSeed(toString(), seed, "Appliance Model" + seed); power = (int) (OfficeComplexConstants.LIGHTS_POWER_VARIANCE * gen.nextGaussian() + OfficeComplexConstants.LIGHTS_POWER_MEAN) * applianceOf.getMembers().size(); cycleDuration = OfficeComplexConstants.LIGHTS_DURATION_CYCLE; }