Skip to contents

Coordinates the generation of synthetic households from a synthetic population using one or more ReplicaStructure objects.

Details

A ReplicaGrouper object manages one or more ReplicaStructure objects and applies household generation algorithms across user-defined population groups.

The class is responsible for:

  • Managing the synthetic population.

  • Coordinating household-generation workflows.

  • Applying household-generation rules within geographic or demographic groups.

  • Assigning household identifiers.

  • Producing household-level summary tables.

Household generation typically proceeds as follows:

  1. Create a ReplicaGrouper.

  2. Create one or more ReplicaStructure objects.

  3. Register the structures using renew.

  4. Execute household generation using manufacture.

During execution:

  1. The synthetic population is partitioned according to group_by.

  2. Households are generated independently within each group.

  3. Household identifiers are assigned.

  4. Household-level summary tables are generated.

Results are returned as:

  • A synthetic population containing household IDs.

  • A synthetic household table.

Slots

population

Synthetic population stored as a data.table.

group_by

Character vector specifying the variables used to partition the synthetic population during household generation.

Typical examples include:

  • "neighb_code"

  • "sa2_code"

  • Geographic or administrative identifiers

position_column

Character string identifying the column containing household-position classifications such as "Parent", "Child" or "SingleAdult".

structures

List of ReplicaStructure objects used during household generation.

Examples

if (FALSE) { # \dontrun{

GROUPER <- ReplicaGrouper(
  population = pop,
  group_by = "neighb_code"
)

STRUCTURE <- ReplicaStructure(
  household_type = "CoupleWithChildren"
)

GROUPER <- renew(
  GROUPER,
  STRUCTURE = STRUCTURE,
  what = "structure"
)

result <- manufacture(
  GROUPER
)

} # }