Identifies and ranks potential secondary partners for a selected primary partner.
Arguments
- object
A
ReplicaStructureobject.- mask
Logical vector identifying agents eligible for partner selection.
- position_value
Character vector containing eligible household-position values.
- primary_partner
Single-row data frame or data.table representing the already-selected primary partner.
- gap_start
Lower bound of the preferred age gap.
- gap_end
Upper bound of the preferred age gap.
Details
Candidates are restricted to eligible household-position categories and are scored according to the age-gap requirements currently being considered.
This function is used internally by
findSecondaryPartner and
pair_partners.
The function:
Restricts candidates to the specified household positions.
Removes agents already listed in
sampled_agents.Removes the primary partner from consideration.
Converts the supplied age gap into an acceptable age range using
calculate_age_range_from_gap.Computes a suitability score for every candidate using score_suitability_by_age_disparity.
Returns candidates sorted from best to worst match.
Lower suitability scores indicate better matches.
Candidates with a suitability score of zero fall within the preferred age-gap range.
