# /* vim: set filetype=awk : */ -*- awk -*- # #---- [effort.awk] ------------------------------------------ #super sub #sizeAgg= sum of sub slocs o #pmBASIC = A* sizeAgg^E* SCED (e and Sced from super) #so subs can't have different values to super function efforts(dad,kids,sizeAgg,pmBasics,kid,pmBasic,pm,out) { if (subParts(dad,kids)) { for(kid in kids) sizeAgg += Ksloc(kid); pmBasics = A(dad)*sizeAgg^E(dad)*Sced(dad); for(kid in Kids) { pmBasic[kid] = pmBasics * Ksloc(kid)/sizeAgg pm[kid] = pmBasic[kid] * EffortMults16(kid) out += pm[kid] } } else { out= Effort(i) } return out } function subParts(x,l, i,n) { n=Slots[x,"child",0]; for(i=1;i<=n;i++) l[i]=Slots[x,"child",i] return n } function Effort(i) { return A(i)* Ksloc(i)^E(i) * Sced(i) * EffortMults16(i) } function EffortMults16(i) { return \ Rely(i) * Data(i) * Cplx(i)* \ Ruse(i) * Docu(i) * Time(i)* \ Stor(i) * Pvol(i) * Acap(i)* \ Pcap(i) * Pcon(i) * Aexp(i)* \ Plex(i) * Ltex(i) * Tool(i)* \ Site(i) ; } function E(i) { return B(i) + 0.01*(Prec(i) + Flex(i) + Resl(i) + Team(i) + Pmat(i)) } function Ksloc(i){ return value(i,"ksloc") } function A(i) { return value(i, "A" ) } function B(i) { return value(i, "B" ) } function Acap(i) { return value(i,"acap") } function Aexp(i) { return value(i,"aexp") } function Cplx(i) { return value(i,"cplx") } function Data(i) { return value(i,"data") } function Docu(i) { return value(i,"docu") } function Flex(i) { return value(i,"flex") } function Ltex(i) { return value(i,"ltex") } function Pcap(i) { return value(i,"pcap") } function Pcon(i) { return value(i,"pcon") } function Plex(i) { return value(i,"plex") } function Pmat(i) { return value(i,"pmat") } function Prec(i) { return value(i,"prec") } function Pvol(i) { return value(i,"pvol") } function Rely(i) { return value(i,"rely") } function Resl(i) { return value(i,"resl") } function Ruse(i) { return value(i,"ruse") } function Sced(i) { return value(i,"sced") } function Site(i) { return value(i,"site") } function Stor(i) { return value(i,"stor") } function Team(i) { return value(i,"team") } function Time(i) { return value(i,"time") } function Tool(i) { return value(i,"tool") } BEGIN { string2pairs(Factors2Numbers, "1,vl,2,l,3,n,4,h,5,vh,6,xh"); } function value(frame,slot, s,t,w,n,x) { s = cachedSlot(frame,slot) if (slot in Type) { n = Factors2Numbers[s]; t = Type[slot]; x = Tunings[t,slot,n] } else { x=s } return x; } function cachedSlot(frame,slot) { if ((frame,slot) in Cache) return Cache[frame,slot]; return Cache[frame,slot] = slot(frame,slot,Slots) } function init(slots, aka) { string2pairs(aka,"yes,1,y,1,true,1,t,1,no,0,n,0,false,0"); readSlots(DefaultData, slots, aka); readSlots(ProjectData, slots, aka); #saya("slots",slots) }