@Test public void BogusShiftConfig () { TreeMap<String, String> map = new TreeMap<String, String>(); map.put("customer.model.liftTruck.instances", "test1, test2, test3"); map.put("customer.model.liftTruck.test1.shiftData", "shift,8,10,8"); map.put("customer.model.liftTruck.test3.shiftData", "block,1,2,3,4,5"); map.put("customer.model.liftTruck.test3.shiftData", "block,1,2,3,4,5, shift,6,8"); config = new MapConfiguration(map); Configurator configurator = new Configurator(); configurator.setConfiguration(config); Collection<?> instances = configurator.configureInstances(LiftTruck.class); assertEquals(3, instances.size(), "three instances"); Map<String, LiftTruck> trucks = mapNames(instances); LiftTruck test1 = trucks.get("test1"); assertNotNull(test1, "found test1"); Shift[] schedule = test1.getShiftSchedule(); for (Shift shift: schedule) { if (null != shift) fail("test1 non-null entry"); } LiftTruck test2 = trucks.get("test2"); assertNotNull(test2, "found test2"); schedule = test2.getShiftSchedule(); for (Shift shift: schedule) { if (null != shift) fail("test1 non-null entry"); } LiftTruck test3 = trucks.get("test3"); assertNotNull(test3, "found test3"); schedule = test3.getShiftSchedule(); for (Shift shift: schedule) { if (null != shift) fail("test1 non-null entry"); } }
Shift[] getShiftSchedule() { return shiftSchedule; }
LiftTruck extends AbstractCustomer implements CustomerModelAccessor { Shift[] getShiftSchedule() { return shiftSchedule; } }
LiftTruck extends AbstractCustomer implements CustomerModelAccessor { Shift[] getShiftSchedule() { return shiftSchedule; } LiftTruck();  LiftTruck(String name); }
LiftTruck extends AbstractCustomer implements CustomerModelAccessor { Shift[] getShiftSchedule() { return shiftSchedule; } LiftTruck();  LiftTruck(String name); @Override void initialize(); @Override CustomerInfo getCustomerInfo(); @Override void step(); @Override String getName(); @Override void setName(String name); @ConfigurableValue(valueType = "Double", dump = false, description = "mean power usage when truck is in use") @StateChange void setTruckKW(double value); double getTruckKW(); @ConfigurableValue(valueType = "Double", dump = false, description = "Std dev of truck power usage") @StateChange void setTruckStd(double stdDev); double getTruckStd(); @ConfigurableValue(valueType = "List", dump = false, description = "shift spec [block, shift, ..., block, shift, ...]") void setShiftData(List<String> data); List<String> getShiftData(); @ConfigurableValue(valueType = "Double", dump = false, description = "size of battery pack in kWh") @StateChange void setBatteryCapacity(double value); double getBatteryCapacity(); @ConfigurableValue(valueType = "Integer", dump = false, description = "total number of battery packs") @StateChange void setNBatteries(int value); int getNBatteries(); @ConfigurableValue(valueType = "Integer", dump = false, description = "number of battery chargers") @StateChange void setNChargers(int value); int getNChargers(); @ConfigurableValue(valueType = "Double", dump = false, description = "maximum charge rate of one truck's battery pack") @StateChange void setMaxChargeKW(double value); double getMaxChargeKW(); @ConfigurableValue(valueType = "Double", dump = false, description = "ratio of charge energy to battery energy") @StateChange void setChargeEfficiency(double value); double getChargeEfficiency(); @ConfigurableValue(valueType = "Integer", dump = false, description = "planning horizon in timeslots - should be at least 48") @StateChange void setPlanningHorizon(int horizon); int getPlanningHorizon(); @ConfigurableValue(valueType = "Integer", dump = false, description = "minimum useful horizon of existing plan") @StateChange void setMinPlanningHorizon(int horizon); int getMinPlanningHorizon(); @StateChange void setEnergyCharging(double kwh); double getEnergyCharging(); void addEnergyCharging(double kwh); @StateChange void setEnergyInUse(double kwh); double getEnergyInUse(); void addEnergyInUse(double kwh); @StateChange void setCapacityInUse(double kwh); double getCapacityInUse(); @Override CapacityProfile getCapacityProfile(Tariff tariff); @Override double getBrokerSwitchFactor(boolean isSuperseding); @Override double getTariffChoiceSample(); @Override double getInertiaSample(); @Override void evaluateTariffs(List<Tariff> tariffs); @Override double getShiftingInconvenienceFactor(Tariff tariff); }
LiftTruck extends AbstractCustomer implements CustomerModelAccessor { Shift[] getShiftSchedule() { return shiftSchedule; } LiftTruck();  LiftTruck(String name); @Override void initialize(); @Override CustomerInfo getCustomerInfo(); @Override void step(); @Override String getName(); @Override void setName(String name); @ConfigurableValue(valueType = "Double", dump = false, description = "mean power usage when truck is in use") @StateChange void setTruckKW(double value); double getTruckKW(); @ConfigurableValue(valueType = "Double", dump = false, description = "Std dev of truck power usage") @StateChange void setTruckStd(double stdDev); double getTruckStd(); @ConfigurableValue(valueType = "List", dump = false, description = "shift spec [block, shift, ..., block, shift, ...]") void setShiftData(List<String> data); List<String> getShiftData(); @ConfigurableValue(valueType = "Double", dump = false, description = "size of battery pack in kWh") @StateChange void setBatteryCapacity(double value); double getBatteryCapacity(); @ConfigurableValue(valueType = "Integer", dump = false, description = "total number of battery packs") @StateChange void setNBatteries(int value); int getNBatteries(); @ConfigurableValue(valueType = "Integer", dump = false, description = "number of battery chargers") @StateChange void setNChargers(int value); int getNChargers(); @ConfigurableValue(valueType = "Double", dump = false, description = "maximum charge rate of one truck's battery pack") @StateChange void setMaxChargeKW(double value); double getMaxChargeKW(); @ConfigurableValue(valueType = "Double", dump = false, description = "ratio of charge energy to battery energy") @StateChange void setChargeEfficiency(double value); double getChargeEfficiency(); @ConfigurableValue(valueType = "Integer", dump = false, description = "planning horizon in timeslots - should be at least 48") @StateChange void setPlanningHorizon(int horizon); int getPlanningHorizon(); @ConfigurableValue(valueType = "Integer", dump = false, description = "minimum useful horizon of existing plan") @StateChange void setMinPlanningHorizon(int horizon); int getMinPlanningHorizon(); @StateChange void setEnergyCharging(double kwh); double getEnergyCharging(); void addEnergyCharging(double kwh); @StateChange void setEnergyInUse(double kwh); double getEnergyInUse(); void addEnergyInUse(double kwh); @StateChange void setCapacityInUse(double kwh); double getCapacityInUse(); @Override CapacityProfile getCapacityProfile(Tariff tariff); @Override double getBrokerSwitchFactor(boolean isSuperseding); @Override double getTariffChoiceSample(); @Override double getInertiaSample(); @Override void evaluateTariffs(List<Tariff> tariffs); @Override double getShiftingInconvenienceFactor(Tariff tariff);  }