Learn R Programming

TUvalues (version 1.1.0)

egalitarian_unions: Egalitarian value with a priori unions

Description

Calculate the egalitarian value in games with a priori unions

Usage

egalitarian_unions(characteristic_func, union, n_players = 0)

Value

The egalitarian value for each player

Arguments

characteristic_func

The valued function defined on the subsets of the number of players

union

List of vectors indicating the a priori unions between the players.

n_players

Only used if characteristic_func is a function. The number of players in the game.

Examples

Run this code
n <- 10
v <- function(coalition) {
  if (length(coalition) > n/2) {
    return(1)
  } else {
    return(0)
  }
}
union <- list(1:4,5:n)
egalitarian_unions(v,union,n)

v <- c(1,1,2,1,2,2,2)
union <- list(c(1,2),c(3))
egalitarian_unions(v, union)

Run the code above in your browser using DataLab