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 void
addEnergyCharging(double kwh)
void
addEnergyInUse(double kwh)
void
evaluateTariffs(List<Tariff> tariffs)
double
getBatteryCapacity()
double
getBrokerSwitchFactor(boolean isSuperseding)
double
getCapacityInUse()
CapacityProfile
getCapacityProfile(Tariff tariff)
double
getChargeEfficiency()
CustomerInfo
getCustomerInfo()
double
getEnergyCharging()
double
getEnergyInUse()
double
getInertiaSample()
double
getMaxChargeKW()
int
getMinPlanningHorizon()
String
getName()
int
getNBatteries()
int
getNChargers()
int
getPlanningHorizon()
List<String>
getShiftData()
double
getShiftingInconvenienceFactor(Tariff tariff)
double
getTariffChoiceSample()
double
getTruckKW()
double
getTruckStd()
void
initialize()
Initialization must provide accessor to Customer instance and time.void
setBatteryCapacity(double value)
void
setCapacityInUse(double kwh)
Updates the total capacity of in-use batteriesvoid
setChargeEfficiency(double value)
void
setEnergyCharging(double kwh)
Updates the energy content of offline batteriesvoid
setEnergyInUse(double kwh)
Updates the energy content of in-use batteriesvoid
setMaxChargeKW(double value)
void
setMinPlanningHorizon(int horizon)
void
setName(String name)
void
setNBatteries(int value)
void
setNChargers(int value)
void
setPlanningHorizon(int horizon)
void
setShiftData(List<String> data)
Converts a list of Strings to a sorted list of Shifts.void
setTruckKW(double value)
void
setTruckStd(double stdDev)
void
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:
initialize
in classAbstractCustomer
-
getCustomerInfo
public CustomerInfo getCustomerInfo()
- Specified by:
getCustomerInfo
in interfaceCustomerModelAccessor
-
step
public void step()
- Specified by:
step
in classAbstractCustomer
-
getName
public String getName()
- Overrides:
getName
in classAbstractCustomer
-
setName
public void setName(String name)
- Overrides:
setName
in 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:
getCapacityProfile
in interfaceCustomerModelAccessor
-
getBrokerSwitchFactor
public double getBrokerSwitchFactor(boolean isSuperseding)
- Specified by:
getBrokerSwitchFactor
in interfaceCustomerModelAccessor
-
getTariffChoiceSample
public double getTariffChoiceSample()
- Specified by:
getTariffChoiceSample
in interfaceCustomerModelAccessor
-
getInertiaSample
public double getInertiaSample()
- Specified by:
getInertiaSample
in interfaceCustomerModelAccessor
-
evaluateTariffs
public void evaluateTariffs(List<Tariff> tariffs)
- Specified by:
evaluateTariffs
in classAbstractCustomer
-
getShiftingInconvenienceFactor
public double getShiftingInconvenienceFactor(Tariff tariff)
- Specified by:
getShiftingInconvenienceFactor
in interfaceCustomerModelAccessor
-
-