Learn R Programming

CoopGame (version 0.2.2)

getEmptyParamCheckResult: 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()

Arguments

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)

See Also

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

Examples

Run this code
# NOT RUN {
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

# }

Run the code above in your browser using DataLab