// Calculates the stats for k. Useful for human-readable output. int calcFitnessDirect(Keyboard *k) { calcFitness(k); // Otherwise, k->fitness, k->fingerUsage, and k->fingerWork // would not get assigned properly. int i; k->distance = 0; k->inRoll = 0; k->outRoll = 0; k->sameHand = 0; k->sameFinger = 0; k->rowChange = 0; k->homeJump = 0; k->ringJump = 0; k->toCenter = 0; k->toOutside = 0; for (i = 0; i < diLen; ++i) scoreDigraphDirect(k, diKeys[i], diValues[i]); for (i = 0; i < monLen; ++i) { k->distance += trueDistance[locWithoutShifted(k, monKeys[i])] * (monValues[i] / 100); // meters } return 0; }
/* * Calculates fitness without score multipliers. Useful for producing * human-readable output. */ int calcFitnessDirect(Keyboard *k) { calcFitness(k); // Otherwise, k->fitness, k->fingerUsage, and k->fingerWork // would not get assigned properly. int i; k->inRoll = 0; k->outRoll = 0; k->sameHand = 0; k->sameFinger = 0; k->rowChange = 0; k->homeJump = 0; k->ringJump = 0; k->toCenter = 0; k->toOutside = 0; for (i = 0; i < diLen; ++i) scoreDigraphDirect(k, digraphs[i].key, digraphs[i].value); return 0; }