From 9d829cb10e3a8eecf7fd70d421b1d95b64a05932 Mon Sep 17 00:00:00 2001 From: Graham Stark Date: Thu, 29 Aug 2024 11:54:31 +0100 Subject: [PATCH] synth data still unfixed --- scripts/fixup_synth_data_v2.jl | 13 +++++++++---- src/Definitions.jl | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/fixup_synth_data_v2.jl b/scripts/fixup_synth_data_v2.jl index 0b574355..bd43bbff 100644 --- a/scripts/fixup_synth_data_v2.jl +++ b/scripts/fixup_synth_data_v2.jl @@ -298,15 +298,20 @@ function assign_child_relationships!(pers :: Vector{MiniPers}, stats::NamedTuple parent.relationships[cn] = relationship_to_parent end end + pretty_table( rel_matrix(pers) ) + for cn in children child = pers[cn] for pn in parents parent = pers[pn] for r in 1:n - child.relationships[r] = - one_generation_relationship( ; - relationship_to_parent = parent.relationships[cn], - parents_relationship_to_person = parent.relationships[r]) + println( "r=$r pn=$pn") + if r != pn + child.relationships[r] = + one_generation_relationship( ; + relationship_to_parent = reciprocal_relationship(parent.relationships[pn]), + parents_relationship_to_person = parent.relationships[r]) + end end end # non 1st bu people. Nearest they can be is sibling, then othen diff --git a/src/Definitions.jl b/src/Definitions.jl index 24cd11e8..53817148 100644 --- a/src/Definitions.jl +++ b/src/Definitions.jl @@ -1530,6 +1530,7 @@ function one_generation_relationship( ; relationship_to_parent :: Relationship, parents_relationship_to_person :: Relationship ) :: Relationship @argcheck relationship_to_parent in [ + # This_Person, Foster_child, Step_son_or_daughter, Son_or_daughter_incl_adopted,