Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jecollins committed Mar 13, 2021
1 parent 8696cf4 commit 94c5443
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,16 @@ private double adjustCapacityForPopulationRatio (
double capacity, TariffSubscription subscription)
{
double popRatio =
getPopulationRatio(subscription.getCustomersCommitted(),
parentBundle.getPopulation());
(double) subscription.getCustomersCommitted() / (double) parentBundle.getPopulation();
logCapacityDetails(logIdentifier + ": population ratio = " + popRatio);
return capacity * popRatio;
}

// TODO -- seems gratuitous
private double getPopulationRatio (int customerCount, int population)
{
return ((double) customerCount) / ((double) population);
}
//private double getPopulationRatio (int customerCount, int population)
//{
// return ((double) customerCount) / ((double) population);
//}

private double adjustCapacityForTariffRates (
int timeslot, double baseCapacity, TariffSubscription subscription)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void initialize (FactoredCustomerService service)
TariffEvaluator evaluator =
createTariffEvaluator(new TariffEvaluationWrapper(bundle))
.withChunkSize(Math.max(1, bundle.getPopulation() / 1000))
// should be a configurable value
.withTariffSwitchFactor(subStructure.getTariffSwitchFactor())
.withPreferredContractDuration(subStructure.getExpectedDuration())
.withInconvenienceWeight(subStructure.getInconvenienceWeight())
Expand Down

0 comments on commit 94c5443

Please sign in to comment.