-
-
Notifications
You must be signed in to change notification settings - Fork 265
/
cocomo.go
25 lines (20 loc) · 858 Bytes
/
cocomo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package processor
import (
"math"
)
// Calculate the cost in dollars applied using generic COCOMO2 weighted values based
// on the average yearly wage
func EstimateCost(effortApplied float64, averageWage int64) float64 {
return effortApplied * float64(averageWage/12) * float64(1.8)
}
// Calculate the effort applied using generic COCOMO2 weighted values
func EstimateEffort(sloc int64) float64 {
var eaf float64 = 1
// Numbers based on organic project, small team, good experience working with requirements
var effortApplied float64 = float64(3.2) * math.Pow(float64(sloc)/1000, 1.05) * eaf
return effortApplied
}
func EstimateScheduleMonths(effortApplied float64) float64 {
// Numbers based on organic project small team, good experience working with requirements
return float64(2.5) * math.Pow(effortApplied, 0.38)
}