|
Relationship Generator 1.2.2
Believable families around a person: parents, siblings, partners and children, with ages and names for C++23
|
Requires C++23 (e.g.,
-std=c++23for GCC/Clang,/std:c++latestfor MSVC).
API Reference · Usage Guide · Data and Method · Releases
Believable families around a person: parents and grandparents, siblings and half-siblings, partners, stepchildren, children and grandchildren, with dates of birth and death and names, drawn from demography (fertility by age, marriage ages, life expectancy) for each country.
stepparents to get the partners a parent took while the anchor was a child, with the children the parent had with them and their own children from before (stepsiblings), and for home to get who the anchor lives with at the reference date (alone, a couple, with children, with parents, three generations), drawn from the country's household figures. Both are off by default and then change nothing else.expand() builds the family of any member of a family so that the two agree.get_family(request, seed) for reproducible results, and family::seed() for replaying a previous generation with the same request and data.extend()), checked before they are applied.to_json() on every result, and a signature() recording the seed and the data it came from.DASMIG_RELATIONSHIP_EMBED to build the lite tier into the program, for WebAssembly and other builds without files.relg instances with their own data and random engine.relgen.hpp is the library released here. Keep core.hpp and the core/ directory (dasmig-core) in the same directory. Add
to the files you want to use it in, and supply the resources folder (or define DASMIG_RELATIONSHIP_EMBED). The library composes birth-generator and name-generator: their headers must be on the include path too, with their data (or DASMIG_BIRTH_EMBED and DASMIG_NAME_EMBED).
See the usage guide for everything else.
Tested with:
-std=c++23)-std=c++23)/std:c++latest)| Dependency | Version | Bundled | Purpose |
|---|---|---|---|
| dasmig-core | 1.4 | Yes (core.hpp, core/) | Platform-independent random engine and distributions, data layers, JSON |
| birth-generator | 3.2 | No (headers on the include path) | The anchor, the country's age pyramid and life expectancy |
| name-generator | 4.5 | No (headers on the include path) | Names by culture, and the names of relatives |
| Catch2 | 3.x | Yes (amalgamated) | Unit testing |
| Library | Description |
|---|---|
| address-generator | Postal addresses with real streets by place |
| biodata-generator | Procedural human physical characteristics |
| birth-generator | Demographically plausible birthdays |
| city-generator | Weighted city selection by population |
| country-generator | Weighted country selection by population |
| device-generator | Devices, browsers, user agents and IP addresses that fit together |
| email-generator | Email addresses in each country's style |
| entity-generator | ECS-based entity generation |
| interest-generator | Religion, hobbies and favourite media by country, age and sex |
| name-generator | Culturally appropriate full names |
| nickname-generator | Gamer-style nicknames |
| occupation-generator | Employment status, education and occupation by country, age and sex |
| persona-generator | Complete characters composed from the other generators |
| phone-generator | Phone numbers valid in each country's numbering plan |
| trait-generator | Personality traits with conflicts, synergies and Big Five axes |
| user-generator | Complete user records: account, username, email, phone and address |
This library is released under the MIT License.