Package org.powertac.common
Class TariffEvaluator
- java.lang.Object
-
- org.powertac.common.TariffEvaluator
-
public class TariffEvaluator extends Object
Tariff evaluation process intended to simplify customer models. There should be one of these created for each CustomerInfo instance within a customer model, since tariff cost values are cached, and are dependent on PowerType.- Author:
- John Collins
-
-
Constructor Summary
Constructors Constructor Description TariffEvaluator(CustomerModelAccessor cma)
TariffEvaluator(CustomerModelAccessor cma, ServerConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
computeInconvenience(Tariff tariff)
Computes composite per-tariff inconvenience of a tariff.void
evaluateTariffs()
Evaluates tariffs and updates subscriptions for a single customer model with a single power type.double
getInterruptibilityFactor()
Returns inconvenience of interruptibility.double
getTieredRateFactor()
Returns inconvenience of tiered rate.double
getTouFactor()
Returns inconvenience of time-of-use rate.double
getVariablePricingFactor()
Returns inconvenience of variable pricing.void
initializeCostFactors(double wtExpected, double wtMax, double wtRealized, double soldThreshold)
Delegates profile cost factors to helper.void
initializeInconvenienceFactors(double touFactor, double tieredRateFactor, double variablePricingFactor, double interruptibilityFactor)
Initializes the per-tariff inconvenience factors.void
initializeRegulationFactors(double expectedCurtailment, double expectedDischarge, double expectedDownRegulation)
Initializes the per-timeslot regulation-capacity estimates.TariffEvaluator
withChunkSize(int size)
Sets the target size of allocation chunks.TariffEvaluator
withEvaluateAllTariffs(boolean value)
If true, then tariff evaluations are not saved; instead, all tariffs are evaluated each time.TariffEvaluator
withInconvenienceWeight(double weight)
Sets the weight given to inconvenience (as opposed to cost) in computing tariff utility.TariffEvaluator
withInertia(double inertia)
Sets the steady-state evaluation inertia for the customer.TariffEvaluator
withPreferredContractDuration(double days)
Sets the preferred maximum contract duration in days.TariffEvaluator
withRationality(double rationality)
Sets the level of rationality for this customer.TariffEvaluator
withSignupBonusFactor(double factor)
Sets the factor by which inertia is multiplied for the case where the current tariff had a positive signup bonus.TariffEvaluator
withTariffEvalDepth(int depth)
Sets the number of tariffs/broker of each applicable PowerType to consider.TariffEvaluator
withTariffSwitchFactor(double factor)
Sets the inconvenience of switching tariffs.
-
-
-
Constructor Detail
-
TariffEvaluator
public TariffEvaluator(CustomerModelAccessor cma, ServerConfiguration config)
-
TariffEvaluator
public TariffEvaluator(CustomerModelAccessor cma)
-
-
Method Detail
-
initializeCostFactors
public void initializeCostFactors(double wtExpected, double wtMax, double wtRealized, double soldThreshold)
Delegates profile cost factors to helper.
-
initializeInconvenienceFactors
public void initializeInconvenienceFactors(double touFactor, double tieredRateFactor, double variablePricingFactor, double interruptibilityFactor)
Initializes the per-tariff inconvenience factors. These are not normalized; it is up to the customer model to normalize the per-tariff and cross-tariff factors as appropriate
-
initializeRegulationFactors
public void initializeRegulationFactors(double expectedCurtailment, double expectedDischarge, double expectedDownRegulation)
Initializes the per-timeslot regulation-capacity estimates. All three represent per-timeslot estimates of exercised regulation capacity, and are applicable only for tariffs with regulation rates. Note that the expectedDischarge parameter only applies to storage devices that can be discharged (batteries, pumped storage). Values are from the customer's viewpoint, so curtailment and discharge are negative (less energy for the customer) and down-regulation is positive. Default value for each of these factors is zero.
-
withChunkSize
public TariffEvaluator withChunkSize(int size)
Sets the target size of allocation chunks. Default is 1. Actual chunk size will be at least 0.5% of the population size.
-
withTariffEvalDepth
public TariffEvaluator withTariffEvalDepth(int depth)
Sets the number of tariffs/broker of each applicable PowerType to consider. Default is 5, which means that only the 5 most recent tariffs of each applicable PowerType from each broker are considered. So if there are 10 brokers, and the PowerType is ELECTRIC_VEHICLE, the applicable PowerTypes would be CONSUMPTION, INTERRUPTIBLE_CONSUMPTION, and ELECTRIC_VEHICLE. If each broker has published at least five tariffs for each of these types, the default value of 5 would result in evaluating up to 150 alternative tariffs in addition to the currently subscribed tariff(s).
-
withEvaluateAllTariffs
public TariffEvaluator withEvaluateAllTariffs(boolean value)
If true, then tariff evaluations are not saved; instead, all tariffs are evaluated each time. This is needed for customers that generate usage profiles that are sensitive to current conditions or state.
-
withInertia
public TariffEvaluator withInertia(double inertia)
Sets the steady-state evaluation inertia for the customer. This is a value in [0,1], where 0 is no inertia (always evaluates), and 1 is total couch-potato inertia (never bothers to evaluate). The instantaneous value starts at zero, so customers will have a chance to switch away from the default tariff at the beginning of a sim, and is temporarily set to zero when a tariff is revoked. Default value is 0.8.
-
withSignupBonusFactor
public TariffEvaluator withSignupBonusFactor(double factor)
Sets the factor by which inertia is multiplied for the case where the current tariff had a positive signup bonus. Should be 0 \le sbf \le 1. Default value is zero.
-
withRationality
public TariffEvaluator withRationality(double rationality)
Sets the level of rationality for this customer. Household customers are expected to have lower rationality than business/industrial/institutional customers. 1.0 is fully rational, 0.5 is quite irrational. A value of zero will result in random choices. Default value is 0.9.
-
withInconvenienceWeight
public TariffEvaluator withInconvenienceWeight(double weight)
Sets the weight given to inconvenience (as opposed to cost) in computing tariff utility. Must be in the range [0,1]. Default value is 0.2.
-
withTariffSwitchFactor
public TariffEvaluator withTariffSwitchFactor(double factor)
Sets the inconvenience of switching tariffs. Default value is 0.04.
-
withPreferredContractDuration
public TariffEvaluator withPreferredContractDuration(double days)
Sets the preferred maximum contract duration in days. For tariffs having a non-zero early-withdrawal fee, this is the period after which the cost of withdrawal is discounted. It is also the standard period over which usage cost is compared against signup/withdrawal payments. Default value is 6 days.
-
evaluateTariffs
public void evaluateTariffs()
Evaluates tariffs and updates subscriptions for a single customer model with a single power type. Also handles tariff revoke/supersede. This requires that each Customer model call this method once on each tariff publication cycle.
-
getTouFactor
public double getTouFactor()
Returns inconvenience of time-of-use rate.
-
getTieredRateFactor
public double getTieredRateFactor()
Returns inconvenience of tiered rate.
-
getVariablePricingFactor
public double getVariablePricingFactor()
Returns inconvenience of variable pricing.
-
getInterruptibilityFactor
public double getInterruptibilityFactor()
Returns inconvenience of interruptibility.
-
computeInconvenience
public double computeInconvenience(Tariff tariff)
Computes composite per-tariff inconvenience of a tariff.
-
-