# NOT RUN {
id = list("prob", "size")
value = list(0.2, 5)
support = list(Interval$new(0,1), PosNaturals$new())
settable = list(TRUE, TRUE)
description = list("Probability of success",NULL)
ps = ParameterSet$new(id, value, support, settable,
description = description)
ps$parameters()
ps$getParameterValue("prob")
ps$getParameterSupport("prob")
id = list("rate", "scale")
value = list(1, 1)
support = list(PosReals$new(), PosReals$new())
settable = list(TRUE, FALSE)
updateFunc = list(NULL, function(self) 1/self$getParameterValue('rate'))
description = list("Arrival rate","Scale parameter")
ps = ParameterSet$new(id, value, support, settable,
updateFunc, description)
ps$parameters(id = "rate")
ps$setParameterValue(rate = 2) # Automatically calls $update
ps$getParameterValue("scale") # Auto-updated to 1/2
# }
Run the code above in your browser using DataLab