public void updateWeight(Map<Class<? extends CandidateGenerator>, Double> weights) {
    weights.merge(RandomCandidateGenerator.class, cost(), Double::sum);
  }
Add the cost of this cost function to the weight of the candidate generator that is optimized
for this cost function. By default it is the RandomCandiateGenerator for a cost function.
Called once per init or after postAction.
@param weights the weights for every generator.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/CostFunction.java