Learn R Programming

socialranking (version 1.2.0)

coalitionsAreIndifferent: Are coalitions indifferent

Description

Check if coalitions are indifferent to one another, or, in other words, if they appear in the same equivalence class.

Usage

coalitionsAreIndifferent(powerRelation, c1, c2)

Value

Logical value TRUE if c1 and c2 are in the same equivalence class, else FALSE.

Arguments

powerRelation

A PowerRelation object created by PowerRelation() or as.PowerRelation()

c1

Coalition vector

c2

Coalition vector

See Also

Other lookup functions: elementLookup(), equivalenceClassIndex()

Examples

Run this code
pr <- PowerRelation(list(list(c(1,2)), list(1, 2)))

stopifnot(coalitionsAreIndifferent(pr, c(1,2), c(1)) == FALSE)
stopifnot(coalitionsAreIndifferent(pr, 2, 1) == TRUE)

# Note that it doesn't fail with non-existing power relations
stopifnot(coalitionsAreIndifferent(pr, 1, c()) == FALSE)
stopifnot(coalitionsAreIndifferent(pr, 3, c(1,2,3)) == TRUE)

Run the code above in your browser using DataLab