characteristicfunction: Characteristicfunction

Description Usage Arguments Value Examples

View source: R/characteristicfunction.R

Description

Characteristic function of a game.

Usage

1

Arguments

n

Number of players

game

Matrix of two columns. The first column contains the coalitions. The second one, the values for each coalition.

Value

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.

Examples

 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

InventorymodelPackage documentation built on May 29, 2017, 9:39 p.m.