package commons.math.formulas;
public class CandidatesWeightEnforcingEqualPairs implements Formula
{

/**
 * Formular for weighting a pair of classifiers that are candidates for merging. INPUT: weight of
 * the best classifier OUTPUT: weight of the second best classifier
 */
public double calculate (double... arg)
{
   double bestValue = arg[0];
   double nextValue = arg[1];
   double w = (bestValue + nextValue) / (1 + Math.abs((bestValue - nextValue)));
   return w;
}
}
