Description Usage Arguments Value Examples
View source: R/characteristicfunction.R
Characteristic function of a game.
1 | characteristicfunction(n, game)
|
n |
Number of players |
game |
Matrix of two columns. The first column contains the coalitions. The second one, the values for each coalition. |
This function gives a matrix. The first n columns indicate a binary representation of the coalitions in a binary mode. The second one, the usual way. The last column gives the characteristic function.
1 2 3 4 5 6 7 8 9 10 11 | characteristicfunction(3,game=cbind(c(1,2,3,12,13,23,123),c(1,1,1,1,2,1,2)))
# 1 2 3 Coalition Cost
# 0 0 0 0 0
# 1 0 0 1 1
# 0 1 0 2 1
# 0 0 1 3 1
# 1 1 0 12 1
# 1 0 1 13 2
# 0 1 1 23 1
# 1 1 1 123 2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.