testUtils

package
v0.0.0-...-4dcd76e Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCount

func CheckCount(t *testing.T, typ string, expected []string, actual *model.Criteria)

func CompareRankings

func CompareRankings(expected, received *AlternativesRanking, t *testing.T)

func CyclicRandomGenerator

func CyclicRandomGenerator(start, cycle int64) func(seed int64) utils.ValueGenerator

func DummyAlternative

func DummyAlternative(id string, value Weight) AlternativeResult

func DummyRankingEntry

func DummyRankingEntry(alts AltsMap, thisAlt string, betterThanOrSameAs ...Alternative) AlternativesRankEntry

func ExtractAlternativesFromResults

func ExtractAlternativesFromResults(a *AlternativeResults) *[]AlternativeWithCriteria

func GenerateCriteria

func GenerateCriteria(number int) Criteria

func TestBiasRanking

func TestBiasRanking(index int, t *testing.T, bias model.BiasListener, params *model.DecisionMakingParams, expectedOrder []string)

func ValidateWeights

func ValidateWeights(t *testing.T, name string, expected, actual Weights)

func WrapAlternatives

func WrapAlternatives(alternativesWeights []model.Weights) []model.AlternativeWithCriteria

Types

type AltsMap

type AltsMap = *map[string]AlternativeResult

func AlternativesResultToMap

func AlternativesResultToMap(a *AlternativeResults) AltsMap

type DummyBiasListener

type DummyBiasListener struct {
}

func (*DummyBiasListener) Identifier

func (d *DummyBiasListener) Identifier() string

func (*DummyBiasListener) Merge

func (*DummyBiasListener) OnCriteriaRemoved

func (d *DummyBiasListener) OnCriteriaRemoved(leftCriteria *model.Criteria, params model.MethodParameters) model.MethodParameters

func (*DummyBiasListener) OnCriterionAdded

func (d *DummyBiasListener) OnCriterionAdded(
	criterion *model.Criterion,
	referenceCriterion *model.Criterion,
	params model.MethodParameters,
	generator utils.ValueGenerator,
) model.AddedCriterionParams

func (*DummyBiasListener) RankCriteriaAscending

func (d *DummyBiasListener) RankCriteriaAscending(params *model.DecisionMakingParams) *model.WeightedCriteria

type DummyMethodParameters

type DummyMethodParameters struct {
	Criteria []string
}

Jump to

Keyboard shortcuts

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