Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateAlternativeHpt(decisionMatrix DecisionMatrix, ...) []float32
- func CalculateLambdaMax(weightedSum WeightedSum, criteriaWeight CriteriaWeight) float32
- func ConsistencyIndex(lambdaMax float32) float32
- func ConsistencyRatio(consistencyIndex float32) float32
- func IsAnswerConsistent(consistencyRatio float32) bool
- func SubSumRow(row [TotalSubCriteria]float32) float32
- func SumRow(row [TotalCriteria]float32) float32
- type ColSum
- type CriteriaWeight
- type DecisionMatrix
- type MPC
- type SubColSum
- type SubCriteriaWeight
- type SubMPC
- type WeightedSum
Constants ¶
View Source
const ( TotalCriteria = 5 TotalSubCriteria = 4 TotalAlternative = 7 )
Variables ¶
View Source
var ( AnswerToFloat = map[string]float32{ "9": 9.0, "7": 7.0, "5": 5.0, "3": 3.0, "1": 1.0, "1/3": 1.0 / 3.0, "1/5": 1.0 / 5.0, "1/7": 1.0 / 7.0, "1/9": 1.0 / 9.0, } NumberToRow = map[int]int{ 15: 1, 16: 2, 17: 3, 18: 4, 19: 2, 20: 3, 21: 4, 22: 3, 23: 4, 24: 4, } NumberToCol = map[int]int{ 15: 0, 16: 0, 17: 0, 18: 0, 19: 1, 20: 1, 21: 1, 22: 2, 23: 2, 24: 3, } RandomIndex = []float32{0.0, 0.0, 0.58, 0.90, 1.12, 1.24, 1.32, 1.41, 1.45, 1.49} AlternativeToRow = map[string]int{ "Multimedia": 0, "Teknik Elektro": 1, "Teknik Listrik": 2, "Tata Busana": 3, "Tata Boga": 4, "Tata Kecantikan": 5, "Teknik Kendaraan Ringan/Motor": 6, } CriteriaToCol = map[string]int{ "total_open_jobs": 0, "salary": 1, "entrepreneurship_opportunity": 2, "interest": 3, "supporting_facilites": 4, } )
Functions ¶
func CalculateAlternativeHpt ¶ added in v1.3.0
func CalculateAlternativeHpt( decisionMatrix DecisionMatrix, allSubCriteriaWeights [TotalCriteria][TotalSubCriteria]float32, criteriaWeight CriteriaWeight, ) []float32
func CalculateLambdaMax ¶
func CalculateLambdaMax(weightedSum WeightedSum, criteriaWeight CriteriaWeight) float32
func ConsistencyIndex ¶
func ConsistencyRatio ¶
func IsAnswerConsistent ¶
func SubSumRow ¶
func SubSumRow(row [TotalSubCriteria]float32) float32
func SumRow ¶
func SumRow(row [TotalCriteria]float32) float32
Types ¶
type CriteriaWeight ¶
type CriteriaWeight = [TotalCriteria]float32
func CalculateCriteriaWeight ¶
func CalculateCriteriaWeight(normMpc MPC) CriteriaWeight
type DecisionMatrix ¶
type DecisionMatrix = [TotalAlternative][TotalCriteria]float32
func BuildDecisionMatrix ¶
func BuildDecisionMatrix( settings []models.QuestionnareSettingAlternative, answers []models.SubmitAnswerRequest, ) (DecisionMatrix, error)
type MPC ¶
type MPC = [TotalCriteria][TotalCriteria]float32
func BuildCriteriaMPC ¶
func BuildCriteriaMPC(data []models.SubmitAnswerRequest) MPC
func NormalizeMPC ¶
type SubCriteriaWeight ¶
type SubCriteriaWeight = [TotalSubCriteria]float32
func CalculateSubCriteriaWeight ¶
func CalculateSubCriteriaWeight(subNormMpc SubMPC) SubCriteriaWeight
type SubMPC ¶
type SubMPC = [TotalSubCriteria][TotalSubCriteria]float32
func BuildSubMPC ¶
func BuildSubMPC() SubMPC
func NormalizeSubMPC ¶
type WeightedSum ¶
type WeightedSum = [TotalCriteria]float32
func CalculateWeightedSum ¶
func CalculateWeightedSum(mpc MPC, criteriaWeight WeightedSum) WeightedSum
Click to show internal directories.
Click to hide internal directories.