
Enhance Replica Modules
Source:R/methods-ReplicaAdder.R, R/methods-ReplicaGrouper.R, R/methods-from-ready4.R
enhance.RdExecutes a replica workflow.
Usage
# S4 method for class 'ReplicaAdder'
enhance(x = "ReplicaAdder", ...)
# S4 method for class 'ReplicaGrouper'
enhance(x, ...)Value
An updated ReplicaAdder.
A list containing:
synthetic_population,synthetic_households, andobject.
The returned population contains one row per synthetic agent, while the household table contains one row per synthetic household.
Details
The behaviour of enhance() depends on the class of the
supplied object.
Methods are currently available for:
ReplicaAdderReplicaGrouper
enhance() is the primary workflow execution method used
by replica modules.
Depending on the module supplied, the method may:
assign attributes to synthetic agents;
generate synthetic households; or
perform other population-enhancement tasks.
ReplicaAdder Method
Executes the attribute-assignment workflow.
The method:
resolves missing contingency groups;
calculates conditional fractions;
converts fractions into agent allocations;
assigns target attribute values; and
updates the synthetic population.
Validation results are cleared before execution and may
subsequently be regenerated using ratify().
The updated synthetic population is stored in:
x@synth_popReplicaGrouper Method
Generates synthetic households from a synthetic
population using one or more registered
ReplicaStructure definitions.
For each grouping region, the method:
identifies eligible household members;
applies registered household structures;
matches agents according to demographic rules;
creates synthetic households;
assigns household identifiers; and
generates household-level outputs.
Household generation is performed independently within
each grouping region defined by the group_by
slot.
Examples
if (FALSE) { # \dontrun{
adder <- enhance(
adder
)
head(
adder@synth_pop
)
} # }
if (FALSE) { # \dontrun{
result <- enhance(
grouper
)
result$synthetic_population
result$synthetic_households
} # }