getEmptyParamCheckResult: getEmptyParamCheckResult for generating stucture according to...

Description Usage Value Author(s) See Also Examples

View source: R/ParameterChecks_CoopGame.R

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

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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

CoopGame documentation built on Aug. 24, 2021, 1:07 a.m.