individual | R Documentation |
The ‘individual' R6 class serves to define individuals’ profiles to be included into population. The object stores information about the individuals' characteristics, as well as the decision rules. The values may be specified as random declaration using statistical functions of 'r' type. The object is initialized without attributes and should be later populated with them.
characteristics
A list of characteristics' definitions
decision_rule
A decision rule object
add_characteristics()
Append a list of 'call' attributes definitions to the attributes.
individual$add_characteristics(...)
...
The attributes should have a name and generation procedure defined (ex: 'Age = rnorm(mean = 40, sd = 10)')
add_decision_rule()
Create or replace an existing decision rule
individual$add_decision_rule(decision_rule)
decision_rule
A decision rule to be assigned to individual profile
get_chars()
Get a vector of available characteristics' names
individual$get_chars()
Character vector with unique characteristics names.
get_laws()
Get a list of alternatives' generation rules
individual$get_laws()
Get a list of laws associated to individual's characteristics.
get_rule()
Extract 'decision_rule' object
individual$get_rule()
A 'decisio_rule' object of the given individual profile.
clone()
The objects of this class are cloneable with this method.
individual$clone(deep = FALSE)
deep
Whether to make a deep clone.
ind <- individual$new() ind$add_characteristics(Age = rnorm(mean = 40, sd = 10)) ind$add_decision_rule(drule <- decision_rule$new()) ind$get_chars() ind$get_laws() ind$get_rule()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.