getEmptyParamCheckResult {CoopGame} | R Documentation |
getEmptyParamCheckResult for generating stucture according to parameter check results
Description
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'.
Usage
getEmptyParamCheckResult()
Value
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)
Author(s)
Johannes Anwander anwander.johannes@gmail.com
See Also
Other ParameterChecks_CoopGame:
stopOnInconsistentEstateAndClaimsVector()
,
stopOnInvalidAllocation()
,
stopOnInvalidBoolean()
,
stopOnInvalidClaimsVector()
,
stopOnInvalidCoalitionS()
,
stopOnInvalidDictator()
,
stopOnInvalidEstate()
,
stopOnInvalidGameVector()
,
stopOnInvalidGrandCoalitionN()
,
stopOnInvalidIndex()
,
stopOnInvalidLeftRightGloveGame()
,
stopOnInvalidNChooseB()
,
stopOnInvalidNumberOfPlayers()
,
stopOnInvalidNumber()
,
stopOnInvalidQuota()
,
stopOnInvalidVetoPlayer()
,
stopOnInvalidWeightVector()
,
stopOnParamCheckError()
Examples
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