// method calculates error between two chains, used in finduniquecombination method // // Chain upper: the first chain, uses i values // Chain lower: the second chain, uses i-1 values // // returns: double of error amount double SearchStrategy::assignmentError(Chain upper, Chain lower) { double AiM1 = (lower.first()).getCAIM()[0]; double BiM1 = (lower.first()).getCBIM()[0]; double Ai = (upper.last()).getCAI()[0]; double Bi = (upper.last()).getCBI()[0]; double squashedError = abs((AiM1 - Ai) / Ai) + abs((BiM1 - Bi)/ Bi); return squashedError; }