@Test public void dailyProfileNormalizedGT0 () { TreeMap<String, String> map = new TreeMap<String, String>(); map.put("evcustomer.beans.activity.instances", "commuting,visit"); map.put("evcustomer.beans.activity.commuting.dailyProfile", "0,0,0,0,0,0,0,0.8,1.0,0.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0"); map.put("evcustomer.beans.activity.visit.weekdayWeight", "0.2"); map.put("evcustomer.beans.activity.visit.weekendWeight", "0.6"); config = new MapConfiguration(map); Configurator configurator = new Configurator(); configurator.setConfiguration(config); Collection<?> instances = configurator.configureInstances(Activity.class); Map<String, Activity> acts = mapNames(instances); Activity commuting = acts.get("commuting"); assertNotNull(commuting); assertTrue(commuting.getDailyProfileOptional().isPresent()); double[] daily = commuting.getDailyProfileOptional().get(); assertNotNull(daily); assertEquals(0.0, daily[3], 1e-6, "zero at 3:00"); assertEquals(0.4, daily[7], 1e-6, ".4 at 7:00"); assertEquals(0.5, daily[8], 1e-6, ".5 at 8:00"); assertEquals(0.1, daily[9], 1e-6, ".1 at 9:00"); }
public Optional<double[]> getDailyProfileOptional () { return Optional.ofNullable(dailyProfile); }
Activity { public Optional<double[]> getDailyProfileOptional () { return Optional.ofNullable(dailyProfile); } }
Activity { public Optional<double[]> getDailyProfileOptional () { return Optional.ofNullable(dailyProfile); } Activity();  Activity(String name); }
Activity { public Optional<double[]> getDailyProfileOptional () { return Optional.ofNullable(dailyProfile); } Activity();  Activity(String name); double getDayWeight(int day); int getId(); String getName(); double getChargerProbability(); void setChargerProbability(double prob); int getInterval(); double getWeekdayWeight(); double getWeekendWeight(); @ConfigurableValue(valueType = "List", dump = false, description = "When this activity might start") void setWeeklyProfile(List<String> value); List<String> getWeeklyProfile(); Optional<double[]> getWeeklyProfileOptional(); @ConfigurableValue(valueType = "List", dump = false, description = "When this activity might start") void setDailyProfile(List<String> value); List<String> getDailyProfile(); Optional<double[]> getDailyProfileOptional(); double getDayProbability(int dayOfWeek); double getProbabilityForTimeslot(int slot); void setInterval(int value); void setId(int value); }
Activity { public Optional<double[]> getDailyProfileOptional () { return Optional.ofNullable(dailyProfile); } Activity();  Activity(String name); double getDayWeight(int day); int getId(); String getName(); double getChargerProbability(); void setChargerProbability(double prob); int getInterval(); double getWeekdayWeight(); double getWeekendWeight(); @ConfigurableValue(valueType = "List", dump = false, description = "When this activity might start") void setWeeklyProfile(List<String> value); List<String> getWeeklyProfile(); Optional<double[]> getWeeklyProfileOptional(); @ConfigurableValue(valueType = "List", dump = false, description = "When this activity might start") void setDailyProfile(List<String> value); List<String> getDailyProfile(); Optional<double[]> getDailyProfileOptional(); double getDayProbability(int dayOfWeek); double getProbabilityForTimeslot(int slot); void setInterval(int value); void setId(int value);  }