Description Usage Arguments Value Author(s) Examples
getPlayersFromBMRow determines players involved in a coalition from the row of a bit matrix
1 | getPlayersFromBMRow(bmRow)
|
bmRow |
represents the bit matrix row |
playerVector contains involved players (e.g. c(1,3), see example below for bitIndex=5 and n=3)
Johannes Anwander anwander.johannes@gmail.com
Jochen Staudacher jochen.staudacher@hs-kempten.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(CoopGame)
bm=createBitMatrix(n=3,A=c(0,0,0,1,1,1,2))
getPlayersFromBMRow(bmRow=bm[4,])
library(CoopGame)
bm=createBitMatrix(n=3,A=c(1:7))
#Corresponding bit matrix:
# cVal
#[1,] 1 0 0 1
#[2,] 0 1 0 2
#[3,] 0 0 1 3
#[4,] 1 1 0 4
#[5,] 1 0 1 5 <=Specified bit index
#[6,] 0 1 1 6
#[7,] 1 1 1 7
#Determine players from bit matrix row by index 5
players=getPlayersFromBMRow(bmRow=bm[5,])
#Result:
players
#[1] 1 3
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.