|
Relationship Generator 1.2.2
Believable families around a person: parents, siblings, partners and children, with ages and names for C++23
|
Return type for family generation. More...
#include <relgen.hpp>
Public Member Functions | |
| const person & | anchor () const |
| The person the family is built around. | |
| std::vector< person > | with_role (relation r) const |
| The members with a given role. | |
| std::vector< person > | parents () const |
| The anchor's parents. | |
| std::vector< person > | siblings () const |
| The anchor's full siblings, oldest first. | |
| std::vector< person > | half_siblings () const |
| The anchor's half-siblings, oldest first. | |
| std::vector< person > | grandparents () const |
| The anchor's grandparents. | |
| std::vector< person > | partners () const |
| The anchor's partners, in the order the unions began. | |
| std::vector< person > | children () const |
| The anchor's children, oldest first. | |
| std::vector< person > | grandchildren () const |
| The anchor's grandchildren, oldest first. | |
| std::vector< person > | stepchildren () const |
| The children of the anchor's partners by earlier unions. | |
| std::vector< person > | stepparents () const |
| The anchor's stepparents: the partners of a parent who are not the other parent. | |
| std::vector< person > | stepsiblings () const |
| The stepparents' children by an earlier union. | |
| std::optional< edge > | union_with (std::size_t partner_id) const |
| The union with a partner. | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this family. | |
| const core::seed_signature & | signature () const |
| The seed and the data this family was generated from. | |
| std::string | to_string () const |
| Human-readable summary string. | |
| void | to_json (core::json_writer &w) const |
| Write this family as a JSON object. | |
| std::string | to_json () const |
| This family as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Static Public Member Functions | |
| static std::string | iso_date (const std::chrono::year_month_day &d) |
A date as YYYY-MM-DD. | |
Public Attributes | |
| std::string | country_code |
| The anchor's country; the family lives there. | |
| std::chrono::year_month_day | reference_date {} |
| The date ages and who is alive refer to. | |
| std::vector< person > | members |
Everyone; members[i].id == i. | |
| std::vector< edge > | edges |
| Parent, sibling and partner links. | |
| data_source | fertility_source {data_source::country} |
| Where the fertility figures came from. | |
| data_source | union_source {data_source::country} |
| Where the marriage figures came from. | |
| std::optional< household > | home {} |
Who the anchor lives with; set only when family_request::home was. // NOLINT(readability-redundant-member-init) | |
Friends | |
| class | relg |
| std::ostream & | operator<< (std::ostream &os, const family &v) |
| Stream the summary to an output stream. | |
Return type for family generation.
Holds the members (the anchor is members[0]) and the links between them, and supports streaming a short summary via operator<< and JSON output via to_json().
Definition at line 353 of file relgen.hpp.
|
inline |
The person the family is built around.
members[0]. Definition at line 366 of file relgen.hpp.
|
inline |
The anchor's children, oldest first.
Definition at line 427 of file relgen.hpp.
|
inline |
The anchor's grandchildren, oldest first.
Definition at line 431 of file relgen.hpp.
|
inline |
The anchor's grandparents.
Definition at line 410 of file relgen.hpp.
|
inline |
The anchor's half-siblings, oldest first.
The children of a parent and a stepparent take ids after the stepparents (see family_request::stepparents), so ids are not in birth order when there are some.
Definition at line 400 of file relgen.hpp.
|
inlinestatic |
A date as YYYY-MM-DD.
| d | The date. |
Definition at line 586 of file relgen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 568 of file relgen.hpp.
|
inline |
The anchor's parents.
Definition at line 383 of file relgen.hpp.
|
inline |
The anchor's partners, in the order the unions began.
Definition at line 423 of file relgen.hpp.
|
inline |
Retrieve the random seed used to generate this family.
Definition at line 466 of file relgen.hpp.
|
inline |
The anchor's full siblings, oldest first.
Definition at line 392 of file relgen.hpp.
|
inline |
The seed and the data this family was generated from.
data is relg::data_hash() at the time of generation. Definition at line 471 of file relgen.hpp.
|
inline |
The children of the anchor's partners by earlier unions.
Definition at line 435 of file relgen.hpp.
|
inline |
The anchor's stepparents: the partners of a parent who are not the other parent.
family_request::stepparents). Definition at line 440 of file relgen.hpp.
|
inline |
The stepparents' children by an earlier union.
family_request::stepparents). Definition at line 449 of file relgen.hpp.
|
inline |
This family as a JSON document.
{"country":"BR","reference_date":"2023-07-01","members":[...],"edges":[...],...}. Definition at line 559 of file relgen.hpp.
|
inline |
Write this family as a JSON object.
| w | Writer positioned where a value is allowed. |
Definition at line 486 of file relgen.hpp.
|
inline |
Human-readable summary string.
BR family of 5 (anchor born 1983-05-20). Definition at line 478 of file relgen.hpp.
|
inline |
The union with a partner.
| partner_id | The partner's id. |
Definition at line 454 of file relgen.hpp.
The members with a given role.
| r | The role. |
Definition at line 371 of file relgen.hpp.
|
friend |
Stream the summary to an output stream.
| os | Output stream. |
| v | The family to stream. |
Definition at line 577 of file relgen.hpp.
|
friend |
Definition at line 594 of file relgen.hpp.
| std::string dasmig::family::country_code |
The anchor's country; the family lives there.
Definition at line 356 of file relgen.hpp.
| std::vector<edge> dasmig::family::edges |
Parent, sibling and partner links.
Definition at line 359 of file relgen.hpp.
| data_source dasmig::family::fertility_source {data_source::country} |
Where the fertility figures came from.
Definition at line 360 of file relgen.hpp.
| std::optional<household> dasmig::family::home {} |
Who the anchor lives with; set only when family_request::home was. // NOLINT(readability-redundant-member-init)
Definition at line 362 of file relgen.hpp.
| std::vector<person> dasmig::family::members |
Everyone; members[i].id == i.
Definition at line 358 of file relgen.hpp.
| std::chrono::year_month_day dasmig::family::reference_date {} |
The date ages and who is alive refer to.
Definition at line 357 of file relgen.hpp.
| data_source dasmig::family::union_source {data_source::country} |
Where the marriage figures came from.
Definition at line 361 of file relgen.hpp.