ahp

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 ConsistencyIndex(lambdaMax float32) float32

func ConsistencyRatio

func ConsistencyRatio(consistencyIndex float32) float32

func IsAnswerConsistent

func IsAnswerConsistent(consistencyRatio float32) bool

func SubSumRow

func SubSumRow(row [TotalSubCriteria]float32) float32

func SumRow

func SumRow(row [TotalCriteria]float32) float32

Types

type ColSum

type ColSum = [TotalCriteria]float32

func CalculateColSum

func CalculateColSum(mpc MPC) ColSum

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

func BuildCriteriaMPC

func BuildCriteriaMPC(data []models.SubmitAnswerRequest) MPC

func NormalizeMPC

func NormalizeMPC(mpc MPC, colSum ColSum) MPC

type SubColSum

type SubColSum = [TotalSubCriteria]float32

func CalculateSubColSum

func CalculateSubColSum(subMpc SubMPC) SubColSum

type SubCriteriaWeight

type SubCriteriaWeight = [TotalSubCriteria]float32

func CalculateSubCriteriaWeight

func CalculateSubCriteriaWeight(subNormMpc SubMPC) SubCriteriaWeight

type SubMPC

func BuildSubMPC

func BuildSubMPC() SubMPC

func NormalizeSubMPC

func NormalizeSubMPC(subMpc SubMPC, subColSum SubColSum) SubMPC

type WeightedSum

type WeightedSum = [TotalCriteria]float32

func CalculateWeightedSum

func CalculateWeightedSum(mpc MPC, criteriaWeight WeightedSum) WeightedSum

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL