Swaps household-position classifications between two agents in a synthetic population.
Arguments
- object
A
ReplicaStructureobject.- agent_1
Identifier of the first agent.
- agent_2
Identifier of the second agent.
Value
An updated ReplicaStructure object.
Details
This function supports fallback partner-matching logic in replica when suitable candidates are unavailable within the preferred household-position pool.
The function:
Retrieves both agents.
Exchanges their household-position values.
Updates the stored synthetic population.
Both agents must belong to the same neighbourhood.
