stopOnInvalidWeightVector {CoopGame}R Documentation

Parameter Function stopOnInvalidWeightVector

Description

stopOnInvalidWeightVector checks if weight vector in a weighted voting game is specified correctly. Validation result gets stored to object paramCheckResult in case an error occured and causes stop otherwise.

Usage

stopOnInvalidWeightVector(paramCheckResult, n, w)

Arguments

paramCheckResult

list object for check result with list element 'errCode' for the error code and 'errMessage' for the error message.

n

represents the number of players

w

numeric vector which contains the weight of each player

Error Code Ranges

Error codes and messages shown to user if error on parameter check occurs

Error Code Message
1110 Number of weights must be equal or greater than number of players in coalition!
1111 Invalid weight vector as w is not numeric

Author(s)

Jochen Staudacher jochen.staudacher@hs-kempten.de

Johannes Anwander anwander.johannes@gmail.com

See Also

Other ParameterChecks_CoopGame: getEmptyParamCheckResult(), stopOnInconsistentEstateAndClaimsVector(), stopOnInvalidAllocation(), stopOnInvalidBoolean(), stopOnInvalidClaimsVector(), stopOnInvalidCoalitionS(), stopOnInvalidDictator(), stopOnInvalidEstate(), stopOnInvalidGameVector(), stopOnInvalidGrandCoalitionN(), stopOnInvalidIndex(), stopOnInvalidLeftRightGloveGame(), stopOnInvalidNChooseB(), stopOnInvalidNumberOfPlayers(), stopOnInvalidNumber(), stopOnInvalidQuota(), stopOnInvalidVetoPlayer(), stopOnParamCheckError()

Examples

library(CoopGame)
paramCheckResult=getEmptyParamCheckResult()
validWeightVector = c(1,2,3)
stopOnInvalidWeightVector(paramCheckResult, n=3, w=validWeightVector)


[Package CoopGame version 0.2.2 Index]