Description Usage Arguments Error Code Ranges Author(s) See Also Examples
View source: R/ParameterChecks_CoopGame.R
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.
1 | stopOnInvalidWeightVector(paramCheckResult, n, w)
|
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 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 |
Jochen Staudacher jochen.staudacher@hs-kempten.de
Johannes Anwander anwander.johannes@gmail.com
Other ParameterChecks_CoopGame:
getEmptyParamCheckResult()
,
stopOnInconsistentEstateAndClaimsVector()
,
stopOnInvalidAllocation()
,
stopOnInvalidBoolean()
,
stopOnInvalidClaimsVector()
,
stopOnInvalidCoalitionS()
,
stopOnInvalidDictator()
,
stopOnInvalidEstate()
,
stopOnInvalidGameVector()
,
stopOnInvalidGrandCoalitionN()
,
stopOnInvalidIndex()
,
stopOnInvalidLeftRightGloveGame()
,
stopOnInvalidNChooseB()
,
stopOnInvalidNumberOfPlayers()
,
stopOnInvalidNumber()
,
stopOnInvalidQuota()
,
stopOnInvalidVetoPlayer()
,
stopOnParamCheckError()
1 2 3 4 | library(CoopGame)
paramCheckResult=getEmptyParamCheckResult()
validWeightVector = c(1,2,3)
stopOnInvalidWeightVector(paramCheckResult, n=3, w=validWeightVector)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.