57 for (
typename std::vector<std::shared_ptr<R> >::const_iterator i = alternatives.begin(); i != alternatives.end() - 1; i++) {
58 std::shared_ptr<R> pR = *i;
59 for (
typename std::vector<std::shared_ptr<R> >::const_iterator j = i + 1; j != alternatives.end(); j++) {
60 std::shared_ptr<R> pS = *j;
63 (pS->getCosts() - pR->getCosts()) /
64 (pS->getCosts() + pR->getCosts());
66 double newPR =
gawronF(pR->getProbability(), pS->getProbability(), delta);
67 double newPS = pR->getProbability() + pS->getProbability() - newPR;
68 if (std::isnan(newPR) || std::isnan(newPS)) {
69 newPR = pS->getCosts() > pR->getCosts()
71 newPS = pS->getCosts() > pR->getCosts()
74 newPR =
MIN2((
double)
MAX2(newPR, (
double) 0), (
double) 1);
75 newPS =
MIN2((
double)
MAX2(newPS, (
double) 0), (
double) 1);
76 pR->setProbability(newPR);
77 pS->setProbability(newPS);