getEmptyParamCheckResult {CoopGame} | R Documentation |
Returns a defined data structure which is intended to store an error code and a message after the check of function parameters was executed. In case parameter check was successfull the error code has the value '0' and the message is 'NULL'.
getEmptyParamCheckResult()
list with 2 elements named errCode which contains an integer representing the error code ('0' if no error) and errMessage for the error message ('NULL' if no error)
Johannes Anwander anwander.johannes@gmail.com
Other ParameterChecks_CoopGame:
stopOnInconsistentEstateAndClaimsVector()
,
stopOnInvalidAllocation()
,
stopOnInvalidBoolean()
,
stopOnInvalidClaimsVector()
,
stopOnInvalidCoalitionS()
,
stopOnInvalidDictator()
,
stopOnInvalidEstate()
,
stopOnInvalidGameVector()
,
stopOnInvalidGrandCoalitionN()
,
stopOnInvalidIndex()
,
stopOnInvalidLeftRightGloveGame()
,
stopOnInvalidNChooseB()
,
stopOnInvalidNumberOfPlayers()
,
stopOnInvalidNumber()
,
stopOnInvalidQuota()
,
stopOnInvalidVetoPlayer()
,
stopOnInvalidWeightVector()
,
stopOnParamCheckError()
library(CoopGame)
initParamCheck_example=function(numberOfPlayers){
paramCheckResult=getEmptyParamCheckResult()
if(numberOfPlayers!=3){
paramCheckResult$errMessage="The number of players is not 3 as expected"
paramCheckResult$errCode=1
}
return(paramCheckResult)
}
initParamCheck_example(3)
#Output:
#$errCode
#[1] 0
#$errMessage
#NULL