// Tariff Evaluation -------------------------------- @Override public void evaluateTariffs() { for (CapacityBundle bundle : capacityBundles) { TariffEvaluator evaluator = evaluatorMap.get(bundle); if (bundle.getSubscriberStructure().getInertiaDistribution() != null) { evaluator.withInertia( bundle.getSubscriberStructure().getInertiaDistribution().drawSample()); } else { log.warn("no inertia distro, using default value 0.7"); evaluator.withInertia(0.7); } evaluator.evaluateTariffs(); } }
DefaultUtilityOptimizer(CustomerStructure customerStructure, List<CapacityBundle> bundles) { this.customerStructure = customerStructure; this.capacityBundles = bundles; this.evaluatorMap = new HashMap<>(); // create evaluation wrappers and tariff evaluators for each bundle for (CapacityBundle bundle : bundles) { TariffSubscriberStructure subStructure = bundle.getSubscriberStructure(); TariffEvaluator evaluator = new TariffEvaluator(new TariffEvaluationWrapper(bundle)) .withChunkSize(Math.max(1, bundle.getPopulation() / 1000)) .withTariffSwitchFactor(subStructure.getTariffSwitchFactor()) .withPreferredContractDuration(subStructure.getExpectedDuration()) .withInconvenienceWeight(subStructure.getInconvenienceWeight()) .withRationality(subStructure.getLogitChoiceRationality()) .withEvaluateAllTariffs(true); evaluator.initializeCostFactors( subStructure.getExpMeanPriceWeight(), subStructure.getMaxValuePriceWeight(), subStructure.getRealizedPriceWeight(), subStructure.getTariffVolumeThreshold()); evaluator.initializeInconvenienceFactors( subStructure.getTouFactor(), subStructure.getTieredRateFactor(), subStructure.getVariablePricingFactor(), subStructure.getInterruptibilityFactor()); evaluatorMap.put(bundle, evaluator); } }
TariffEvaluationWrapper(CapacityBundle bundle) { this.bundle = bundle; subStructure = bundle.getSubscriberStructure(); }