function pivotedLine (x, slope) { return (1 + (slope * (x - 3))) } function hingedLine (x, slope) { return (slope * (x - 6)) } function coqualmoLine (x, slope) { return (slope * (x - 1)) } function em2effort(key, project) { return pivotedLine(project[getRating(key)], project[getEffortSlope(key)]) } function em2rin(key, project) { return pivotedLine(project[getRating(key)], project[getReqSlope(key)]) } function em2din(key, project) { return pivotedLine(project[getRating(key)], project[getDesignSlope(key)]) } function em2cin(key, project) { return pivotedLine(project[getRating(key)], project[getCodeSlope(key)]) } function sf2effort(key, project) { return hingedLine(project[getRating(key)], project[getEffortSlope(key)]) } function sf2rin(key, project) { return pivotedLine(project[getRating(key)], project[getReqSlope(key)]) } function sf2din(key, project) { return pivotedLine(project[getRating(key)], project[getDesignSlope(key)]) } function sf2cin(key, project) { return pivotedLine(project[getRating(key)], project[getCodeSlope(key)]) } function dr2rout(key, project) { return coqualmoLine(project[getRating(key)], project[getReqSlope(key)]) } function dr2dout(key, project) { return coqualmoLine(project[getRating(key)], project[getDesignSlope(key)]) } function dr2cout(key, project) { return coqualmoLine(project[getRating(key)], project[getCodeSlope(key)]) } #for all attributes, look up attr range in model, pick a tuning within that range function getTunings(project, model, indx,keys,key,slope) { split(model[getKeys()], keys, " ") project[getTuning("ksloc")] = int(pickRange(2, 2000)) project[getTuning("a")] = getA() project[getTuning("b")] = getB(project[getTuning("a")]) for (indx in keys) { key = keys[indx] project[getEffortSlope(key)] = \ pickRange( \ model[getSlopeMin(model[getEffortSlope(key)])], model[getSlopeMax(model[getEffortSlope(key)])]) project[getReqSlope(key)] = \ pickRange( \ model[getSlopeMin(model[getReqSlope(key)])], model[getSlopeMax(model[getReqSlope(key)])]) project[getDesignSlope(key)] = \ pickRange( \ model[getSlopeMin(model[getDesignSlope(key)])], model[getSlopeMax(model[getDesignSlope(key)])]) project[getCodeSlope(key)] = \ pickRange( \ model[getSlopeMin(model[getCodeSlope(key)])], model[getSlopeMax(model[getCodeSlope(key)])]) } } function getA() { return pickRange(2, 10) } #falls under the line defined by the points (2,1) and (10,0.6) # slope = -(0.4) / 8 = -0.05 # y-intercept = 1/(-0.05 * 2) = 1.1 # b = -0.05a + 1.1 function getB(a) { return pickRange(0, -0.05 * a + 1.1) }