v <- c(2,3,5,5,7,8,10)
centroid(v, method = "exact")
centroid(v, method = "appro", n_rep = 100)
n <- 3
v <- function(coalition) {
size <- length(coalition)
if (size <= 1) {
return(0)
} else if (size == 2) {
return(10)
} else if (size == 3) {
return(24)
} else {
return(0)
}
}
centroid(v, n, method = "exact")
centroid(v, n, method = "appro", n_rep = 200)
Run the code above in your browser using DataLab