public TariffEvaluator (CustomerModelAccessor cma) { accessor = cma; customerInfo = cma.getCustomerInfo(); helper = new TariffEvaluationHelper(); evaluatedTariffs = new HashMap<>(); allocations = new LinkedHashMap<>(); }
/** * Delegates profile cost factors to helper. */ public void initializeCostFactors (double wtExpected, double wtMax, double wtRealized, double soldThreshold) { helper.initializeCostFactors(wtExpected, wtMax, wtRealized, soldThreshold); }
Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start));
expDown = 0.0; helper.initializeRegulationFactors(expCurtail, expDis, expDown);
Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start));
Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start));
Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start));
Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start));
Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start)); Math.abs(tariffEvalHelper.estimateCost(tariff, newTemp, start));
private double forecastCost (Tariff tariff) { CapacityProfile profile = accessor.getCapacityProfile(tariff); if (0 == profile.getProfile().length) { log.error("Zero-length profile for " + customerInfo.getName()); return 0.0; } setProfileLength(profile.getProfile().length); // NOTE: must call the next function after the previous, // since the previous writes inconv. factors. // Always 0 except for AdaptiveCapacityOriginator double inconv = accessor.getShiftingInconvenienceFactor(tariff); double profileCost = helper.estimateCost(tariff, profile.getProfile(), profile.getStart()); if (Double.isNaN(profileCost)) { log.error(getName() + ": profile cost NaN for tariff " + tariff.getId()); } //double scale = preferredDuration * 24.0 / profile.length; double scale = stdDuration * 24.0 / getProfileLength(); if (Double.isNaN(scale)) { log.error(getName() + ": scale NaN for tariff " + tariff.getId()); } log.debug("tariff {}: profileCost={}, inconv={}, scaled-charge={}, scaled (cost+inconv)={}", tariff.getId(), profileCost, inconv, profileCost * scale, (profileCost + inconv) * scale, (profileCost + inconv) * scale / (profileCost * scale)); return (profileCost + inconv) * scale; }