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)Called to evaluate tariffs.doublegetBatteryCapacity()doublegetBrokerSwitchFactor(boolean isSuperseding)Returns a [0,1] value representing the inconvenience of switching brokers.doublegetCapacityInUse()CapacityProfilegetCapacityProfile(Tariff tariff)Returns a capacity profile for the given tariff.doublegetChargeEfficiency()CustomerInfogetCustomerInfo()Returns the CustomerInfo instance for this customer model.doublegetEnergyCharging()doublegetEnergyInUse()doublegetInertiaSample()Returns a [0,1] random value used to choose whether individual customers evaluate tariffs or not.doublegetMaxChargeKW()intgetMinPlanningHorizon()StringgetName()Returns the name of this modelintgetNBatteries()intgetNChargers()intgetPlanningHorizon()List<String>getShiftData()doublegetShiftingInconvenienceFactor(Tariff tariff)Returns a [0,1] value representing the inconvenience of dealing with curtailment in exchange for a lower price.doublegetTariffChoiceSample()Returns a [0,1] random value used to make choices using the logit choice model.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)Sets the name for this modelvoidsetNBatteries(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()Called to run the model forward one step.-
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()
Description copied from interface:CustomerModelAccessorReturns the CustomerInfo instance for this customer model.- Specified by:
getCustomerInfoin interfaceCustomerModelAccessor
-
step
public void step()
Description copied from class:AbstractCustomerCalled to run the model forward one step.- Specified by:
stepin classAbstractCustomer
-
getName
public String getName()
Description copied from class:AbstractCustomerReturns the name of this model- Overrides:
getNamein classAbstractCustomer
-
setName
public void setName(String name)
Description copied from class:AbstractCustomerSets the name for this model- 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)
Description copied from interface:CustomerModelAccessorReturns a capacity profile for the given tariff. This must represent the usage of a single individual in a population model over some model-specific time period.- Specified by:
getCapacityProfilein interfaceCustomerModelAccessor
-
getBrokerSwitchFactor
public double getBrokerSwitchFactor(boolean isSuperseding)
Description copied from interface:CustomerModelAccessorReturns a [0,1] value representing the inconvenience of switching brokers. The value may depend on whether the current subscription is being switched to a superseding tariff as a result of revocation.- Specified by:
getBrokerSwitchFactorin interfaceCustomerModelAccessor
-
getTariffChoiceSample
public double getTariffChoiceSample()
Description copied from interface:CustomerModelAccessorReturns a [0,1] random value used to make choices using the logit choice model.- Specified by:
getTariffChoiceSamplein interfaceCustomerModelAccessor
-
getInertiaSample
public double getInertiaSample()
Description copied from interface:CustomerModelAccessorReturns a [0,1] random value used to choose whether individual customers evaluate tariffs or not.- Specified by:
getInertiaSamplein interfaceCustomerModelAccessor
-
evaluateTariffs
public void evaluateTariffs(List<Tariff> tariffs)
Description copied from class:AbstractCustomerCalled to evaluate tariffs.- Specified by:
evaluateTariffsin classAbstractCustomer
-
getShiftingInconvenienceFactor
public double getShiftingInconvenienceFactor(Tariff tariff)
Description copied from interface:CustomerModelAccessorReturns a [0,1] value representing the inconvenience of dealing with curtailment in exchange for a lower price.- Specified by:
getShiftingInconvenienceFactorin interfaceCustomerModelAccessor
-
-