Package org.powertac.customer.model
Class LiftTruck
- java.lang.Object
-
- org.powertac.customer.AbstractCustomer
-
- org.powertac.customer.model.LiftTruck
-
- All Implemented Interfaces:
CustomerModelAccessor
@Domain @ConfigurableInstance public class LiftTruck extends AbstractCustomer implements CustomerModelAccessor
Models the complement of lift trucks in a warehouse. There may be multiple trucks, some number of battery packs, and a daily/weekly work schedule. Since the lead-acid batteries in most lift trucks have a limited number of charge/discharge cycles, we do not assume the ability to discharge batteries into the grid to provide balancing capacity. However, the charging rate is variable, and balancing capacity can be provided by adjusting the rate. Batteries and battery chargers are not modeled directly; instead, we simply keep track of the overall battery capacity and how it changes when shifts start and end, and when chargers run. Instances are created using the configureInstances() method. In addition to simple parameters, configuration can specify a shift schedule and the number and initial state-of-charge of battery packs. The work schedule is specified with a list of strings called weeklySchedule that lays out blocks of shifts. Each block is of the form
"block", d1, d2, ..., "shift" start, duration, ntrucks, "shift", ...
where d1, d2, etc. are integers giving the days of the week covered by the block, with Sunday=0; start is an integer hour, duration is an integer number of hours, and ntrucks is the number of trucks that will be active during the shift.- Author:
- John Collins
-
-
Field Summary
-
Fields inherited from class org.powertac.customer.AbstractCustomer
allCustomerInfos, customerInfos, name, rs1, service
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEnergyCharging(double kwh)voidaddEnergyInUse(double kwh)voidevaluateTariffs(List<Tariff> tariffs)doublegetBatteryCapacity()doublegetBrokerSwitchFactor(boolean isSuperseding)doublegetCapacityInUse()CapacityProfilegetCapacityProfile(Tariff tariff)doublegetChargeEfficiency()CustomerInfogetCustomerInfo()doublegetEnergyCharging()doublegetEnergyInUse()doublegetInertiaSample()doublegetMaxChargeKW()intgetMinPlanningHorizon()StringgetName()intgetNBatteries()intgetNChargers()intgetPlanningHorizon()List<String>getShiftData()doublegetShiftingInconvenienceFactor(Tariff tariff)doublegetTariffChoiceSample()doublegetTruckKW()doublegetTruckStd()voidinitialize()Initialization must provide accessor to Customer instance and time.voidsetBatteryCapacity(double value)voidsetCapacityInUse(double kwh)Updates the total capacity of in-use batteriesvoidsetChargeEfficiency(double value)voidsetEnergyCharging(double kwh)Updates the energy content of offline batteriesvoidsetEnergyInUse(double kwh)Updates the energy content of in-use batteriesvoidsetMaxChargeKW(double value)voidsetMinPlanningHorizon(int horizon)voidsetName(String name)voidsetNBatteries(int value)voidsetNChargers(int value)voidsetPlanningHorizon(int horizon)voidsetShiftData(List<String> data)Converts a list of Strings to a sorted list of Shifts.voidsetTruckKW(double value)voidsetTruckStd(double stdDev)voidstep()-
Methods inherited from class org.powertac.customer.AbstractCustomer
addCustomerInfo, changeSubscription, createTariffEvaluator, getCurrentSubscriptions, getCurrentSubscriptions, getCustId, getCustomerInfo, getCustomerInfoList, getCustomerInfos, getId, getPopulation, lastSunday, nextStartOfDay, saveBootstrapState, setServiceAccessor, setTariffMarket, startOfDay, toString
-
-
-
-
Constructor Detail
-
LiftTruck
public LiftTruck()
Default constructor, requires manual setting of name
-
LiftTruck
public LiftTruck(String name)
Standard constructor for named configurable type
-
-
Method Detail
-
initialize
public void initialize()
Initialization must provide accessor to Customer instance and time. We assume configuration has already happened. We also start with no active trucks, and the weakest batteries on availableChargers. Trucks will not be active (in bootstrap mode) until the first shift change.- Overrides:
initializein classAbstractCustomer
-
getCustomerInfo
public CustomerInfo getCustomerInfo()
- Specified by:
getCustomerInfoin interfaceCustomerModelAccessor
-
step
public void step()
- Specified by:
stepin classAbstractCustomer
-
getName
public String getName()
- Overrides:
getNamein classAbstractCustomer
-
setName
public void setName(String name)
- Overrides:
setNamein classAbstractCustomer
-
setTruckKW
@ConfigurableValue(valueType="Double", dump=false, description="mean power usage when truck is in use") @StateChange public void setTruckKW(double value)
-
getTruckKW
public double getTruckKW()
-
setTruckStd
@ConfigurableValue(valueType="Double", dump=false, description="Std dev of truck power usage") @StateChange public void setTruckStd(double stdDev)
-
getTruckStd
public double getTruckStd()
-
setShiftData
@ConfigurableValue(valueType="List", dump=false, description="shift spec [block, shift, ..., block, shift, ...]") public void setShiftData(List<String> data)Converts a list of Strings to a sorted list of Shifts. Entries in the list represent pairs of (start, duration) values.
-
setBatteryCapacity
@ConfigurableValue(valueType="Double", dump=false, description="size of battery pack in kWh") @StateChange public void setBatteryCapacity(double value)
-
getBatteryCapacity
public double getBatteryCapacity()
-
setNBatteries
@ConfigurableValue(valueType="Integer", dump=false, description="total number of battery packs") @StateChange public void setNBatteries(int value)
-
getNBatteries
public int getNBatteries()
-
setNChargers
@ConfigurableValue(valueType="Integer", dump=false, description="number of battery chargers") @StateChange public void setNChargers(int value)
-
getNChargers
public int getNChargers()
-
setMaxChargeKW
@ConfigurableValue(valueType="Double", dump=false, description="maximum charge rate of one truck\'s battery pack") @StateChange public void setMaxChargeKW(double value)
-
getMaxChargeKW
public double getMaxChargeKW()
-
setChargeEfficiency
@ConfigurableValue(valueType="Double", dump=false, description="ratio of charge energy to battery energy") @StateChange public void setChargeEfficiency(double value)
-
getChargeEfficiency
public double getChargeEfficiency()
-
setPlanningHorizon
@ConfigurableValue(valueType="Integer", dump=false, description="planning horizon in timeslots - should be at least 48") @StateChange public void setPlanningHorizon(int horizon)
-
getPlanningHorizon
public int getPlanningHorizon()
-
setMinPlanningHorizon
@ConfigurableValue(valueType="Integer", dump=false, description="minimum useful horizon of existing plan") @StateChange public void setMinPlanningHorizon(int horizon)
-
getMinPlanningHorizon
public int getMinPlanningHorizon()
-
setEnergyCharging
@StateChange public void setEnergyCharging(double kwh)
Updates the energy content of offline batteries
-
getEnergyCharging
public double getEnergyCharging()
-
addEnergyCharging
public void addEnergyCharging(double kwh)
-
setEnergyInUse
@StateChange public void setEnergyInUse(double kwh)
Updates the energy content of in-use batteries
-
getEnergyInUse
public double getEnergyInUse()
-
addEnergyInUse
public void addEnergyInUse(double kwh)
-
setCapacityInUse
@StateChange public void setCapacityInUse(double kwh)
Updates the total capacity of in-use batteries
-
getCapacityInUse
public double getCapacityInUse()
-
getCapacityProfile
public CapacityProfile getCapacityProfile(Tariff tariff)
- Specified by:
getCapacityProfilein interfaceCustomerModelAccessor
-
getBrokerSwitchFactor
public double getBrokerSwitchFactor(boolean isSuperseding)
- Specified by:
getBrokerSwitchFactorin interfaceCustomerModelAccessor
-
getTariffChoiceSample
public double getTariffChoiceSample()
- Specified by:
getTariffChoiceSamplein interfaceCustomerModelAccessor
-
getInertiaSample
public double getInertiaSample()
- Specified by:
getInertiaSamplein interfaceCustomerModelAccessor
-
evaluateTariffs
public void evaluateTariffs(List<Tariff> tariffs)
- Specified by:
evaluateTariffsin classAbstractCustomer
-
getShiftingInconvenienceFactor
public double getShiftingInconvenienceFactor(Tariff tariff)
- Specified by:
getShiftingInconvenienceFactorin interfaceCustomerModelAccessor
-
-