mars-censere
A framework for numerical simulations of human settlement of Mars
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Repository
A framework for numerical simulations of human settlement of Mars
Basic Info
Statistics
- Stars: 0
- Watchers: 0
- Forks: 2
- Open Issues: 11
- Releases: 0
Metadata Files
README.md
Mars Censere
This project is aimed at building a robust population model for humanity on Mars.
The name comes from the Latin for "census", since it is simulating a population at the (named) individual level, rather than the macro level.
This is a work in progress, the models are still being developed, but for an (old) graphical view of the sort of data we are producing take a look look at docs/dashboard.png
Getting Involved
The idea for the project came out of a series of presentations at the European Mars Conference in 2019, where papers were discussing city designs for 1000 people on Mars. But no mention during the presentations of how the population would get to that number.
The novel thing about this is that we are simulating individuals, it tracks family lines so we can limit close genetic mixing. The intent being to allow extending into economic models later (resource requirements, family wealth, wealth distribution etc).
It is also a numerical simulation - its expected that a large number of simulations will be run ("wisdom of the masses") rather than anointing a specific set of calculation factors as "correct"
Quick Start
This was developed using Python 3.8+. It will probably work on earlier versions of Python 3. Not interested in supporting Python 2 at this point.
There are expected to be multiple components in the project, currently
we are separating the simulation run from any downstream analsis to allow simulation to run in parallel on large machines.
The simulation run (generator) outputs into a SQLite database,
which can be loaded into pandas, R etc) as desired.
The database can hold multiple simulations so you can analyse the impact of changing the simulation model.
Basic Usage
``` mars-censere Usage: mars-censere [OPTIONS] COMMAND [ARGS]...
Options: --help Show this message and exit.
COMMANDS: dashboard - Interactive UI for viewing simulation results generator - Generate simulation data merge - Merge results from separate databases
For additional help on a command use
`censere <CMD> --help`
or
censere <CMD> --hints
```
``` mars-censere --help Usage: mars-censere [OPTIONS] COMMAND [ARGS]...
Options: -v, --verbose INTEGER Set system-wide verbosity --debug Run in development mode (additional logging) --log-level LOGGER=LEVEL Override logging level for given logger --database PATH Path to database (CENSEREDATABASE) --dump Dump the simulation parameters to stdout (CENSEREDUMP) --debug-sql Enable debug mode for SQL queries (CENSEREDEBUGSQL) --help Show this message and exit. ```
``` mars-censere generator --help Usage: mars-censere generator [OPTIONS]
Generate simulation data
Options: --random-seed RAND Seed used to initialize random engine (CENSEREGENERATORSEED) --continue-simulation ID Continue simulation ID to a new limit (CENSEREGENERATORCONTINUESIMULATION) --notes TEXT Add TEXT into notes column in simulations table (CENSEREGENERATORNOTES) --database-dir DIR Use a unique file in DIR. This takes priority over --database. Unique file is based on the simulation id (CENSEREGENERATORDATABASEDIR) --astronaut-age-range RANDOM Age range (years) of arriving astronauts (CENSEREGENERATORASTRONAUTAGERANGE) --astronaut-gender-ratio MALE,FEMALE Male:Female ratio for astronauts, MUST add up to 100 (CENSEREGENERATORASTRONAUTGENDERRATIO) --astronaut-life-expectancy RANDOM Life expectancy of arriving astronauts (CENS EREGENERATORASTRONAUTLIFEEXPECTANCY) --common-ancestor GENERATION Allow realtionships where common ancestor is older than GEN. GEN=1 => parent, GEN=2 => grandparent etc (CENSEREGENERATORCOMMONANCESTOR) --first-child-delay RANDOM 'Delay (sols) between relationship start and first child (CENSEREGENERATORFIRSTCHILDDELAY) --fraction-singles-pairing-per-day FRACTION The fraction of singles that will start a relationship PER DAY (CENSEREGENERATORFRACTIONSINGLESPAIRING) --fraction-relationships-having-children FRACTION The fraction of relationships that will have children (CENSEREGENERATORFRACTIONRELATIO NSHIPSHAVINGCHILDREN) --martian-gender-ratio MALE,FEMALE Male:Female ratio for new born martians, MUST add up to 100 (CENSEREGENERATIORMARTIANGENDERRATIO) --martian-life-expectancy RANDOM Life expectancy of new born martians (CENSEREGENERATORMARTIANLIFEEXPECTANCY) --orientation HETROSEXUAL,HOMOSEXUAL,BISEXUAL Sexual orientation percentages, MUST add up to 100 (CENSEREGENERATOROREINTATION) --partner-max-age-difference YEARS Limit possible relationships to partners with maximum age difference (CENSEREGENERAT ORPARTNERMAXAGEDIFFERENCE) --relationship-length RANDOM How many SOLS a relationship lasts (CENSEREGENERATORRELATIONSHIPLENGTH) --sols-between-siblings RANDOM Gap between sibling births (CENSEREGENERATORSOLSBETWEENSIBLINGS) --use-ivf Use IFV to extend fertility (CENSEREGENERATORUSEIFV) --initial-mission-lands DATETIME Earth date that initial mission lands on Mars (CENSEREGENERATORINITIALMISSIONLANDS) --limit [sols|population] End simulation when we hit a time or population limit (CENSEREGENERATORLIMIT) --limit-count INTEGER Stop simulation when reaching this sols/population count (CENSEREGENERATORLIMITCOUNT) --mission-lands RANDOM Land a new mission every RANDOM sols (CENSEREGENERATORMISSIONLANDS) --initial-settlers-per-ship RANDOM Number of arriving astronauts (per ship) for the initial mission (CENSEREGENERATORINITI ALSETTLERSPERSHIP) --initial-ships-per-mission RANDOM Number of ships for the initial mission (CEN SEREGENERATORINITIALSHIPSPERMISSION) --settlers-per-ship RANDOM Number of arriving astronauts (per ship) for subsequent missions (CENSEREGENERATORSETTLERSPERSHIP) --ships-per-mission RANDOM Number of ships for subsequent missions (CENSEREGENERATORSHIPSPERMISSION) --cache-details Log cache effectiveness as the simulation runs (CENSEREGENERATORCACHEDETAILS) --hints Print additional help --help Show this message and exit. ```
``` mars-censere generator --hints
The Database should be on a local disk - not in Dropbox etc.
RANDOM Values
This can be calculated using built-in tables from the CDC, or a random function
The option is specified as string:arg1,arg2,..argn
Acceptable Values are:
cdc: use CDC tables (no args are needed). This is only valid for Life Expectancy
triangular:MIN,PEAK,MAX use NUMPY's triangular random function with MIN,PEAK and MAX ages (in earth years)
guass:MEAN,STDDEV use NUMPY's guass random function with MEAN and STDDEV ages (in earth years)
randint:MIN,MAX use NUMPY's randint random function with MIN and MAX ages such that MIN <= N <= MAX (in earth years)
randrange:MIN,MAX use NUMPY's randint random function with MIN and MAX ages such that MIN <= N < MAX (in earth years)
half:BEGIN,STEP There is a 50% probability that a value between BEGIN and BEGIN+STEP will be picked, 25% between BEGIN+STEP and BEGIN+(STEP2), a 12.5% between BEGIN+(STEP2) and BEGIN+(STEP*3) etc.
```
Censere will read values from the environment as listed in the help text (i.e. the database can be set using the environment variable CENSERE_DATABASE)
Then run the generator to run the simulation - a small run to start off.
% mars-censere generator --limit-count=100
2019-11-21T11:26:07 NOTICE Mars Censere 2019.325
2019-11-21T11:26:07 NOTICE 1.1 (1) Simulation eff6acc5-a6a8-4cdb-9a37-b9f133078560 Started. Goal population = 100
2019-11-21T11:26:07 NOTICE 1.1 Mission landed with 20 colonists
2019-11-21T11:26:07 NOTICE 1.28 (28) #Colonists 20
2019-11-21T11:26:07 NOTICE 1.56 (56) #Colonists 20
2019-11-21T11:26:07 NOTICE 1.63 Martian Jesse Johnson (d8d54575-b4c0-4fab-8a92-35c2455f02d0) born
2019-11-21T11:26:07 NOTICE 1.84 (84) #Colonists 21
2019-11-21T11:26:07 NOTICE 1.106 Martian Brenda White (2717a34f-aa95-4809-8ad1-9fb2f0fc6025) born
2019-11-21T11:26:07 NOTICE 1.112 (112) #Colonists 22
2019-11-21T11:26:07 NOTICE 1.140 (140) #Colonists 22
...
2019-11-21T11:26:10 NOTICE 2.588 (1256) #Colonists 90
2019-11-21T11:26:10 NOTICE 2.616 (1284) #Colonists 90
2019-11-21T11:26:10 NOTICE 2.630 Martian Joshua Gray (73b83747-5883-499d-b7df-9b5bb291c495) born
2019-11-21T11:26:10 NOTICE 2.644 (1312) #Colonists 91
2019-11-21T11:26:10 NOTICE 3.0 (1336) #Colonists 91
2019-11-21T11:26:10 NOTICE 3.28 (1364) #Colonists 91
2019-11-21T11:26:10 NOTICE 3.56 (1392) #Colonists 91
2019-11-21T11:26:10 NOTICE 3.84 (1420) #Colonists 91
2019-11-21T11:26:11 NOTICE 3.112 (1448) #Colonists 91
2019-11-21T11:26:11 NOTICE 3.140 (1476) #Colonists 91
2019-11-21T11:26:11 NOTICE 3.168 (1504) #Colonists 91
2019-11-21T11:26:11 NOTICE 3.183 Mission landed with 69 colonists
2019-11-21T11:26:11 NOTICE 3.184 (1520) Simulation eff6acc5-a6a8-4cdb-9a37-b9f133078560 Complete. population 160 >= 100
Building
It can be simply installed into a Python virtual env.
% pip3 install --upgrade build
% pip install .
Using Docker
There is a script scripts/build.sh that will build a docker image
SQLite is not intended for parallel use, best practice is to mount a directory into the container and then specify a run specific database i.e.
docker run -it -d -v $(pwd)/sims/:/data $image --database-dir=/data/
Then merge all the individual simulations into a single database for
reporting/analysis (mars-censere merge sims/*.db)
Post-simulation Analysis
There is an early version of an interactive graphical dashboard in
censere/cmds/dashboard.py - it reads from a previously generated database.
% mars-censere --database sims/202002021525.db dashboard

The analysis of simulations is currently a WIP, currently the plan is to move to using Jupyter (python) rather than the initial R-based notebooks.
Owner
- Name: badonhill-io
- Login: badonhill-io
- Kind: organization
- Repositories: 1
- Profile: https://github.com/badonhill-io
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: >-
Censere - a Framework for Numerically Simulating the Human
Settlement of Mars
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Richard
family-names: Offer
email: roffer@badonhill.io
orcid: 'https://orcid.org/0000-0001-7184-1331'
affiliation: Badon Hill Technologies
repository-code: 'https://github.com/badonhill-io/mars-censere'
abstract: >
Application framework for the numerical simulation of
human settlement of Mars. The simulation works at the
(named) individual level to allow following of individual
families over multiple generations. This is a framework
in that the mission parameters are not annointed and
are typically randomised with given ranges.
keywords:
- Human settlement of Mars
- numerical simulation
- Python
license: BSD-4-Clause
GitHub Events
Total
Last Year
Dependencies
- actions/checkout v3 composite
- base latest build
- python alpine build
- Cython *
- Flask *
- Jinja2 *
- MarkupSafe *
- Werkzeug *
- attrs *
- click *
- dash *
- dash-core-components *
- dash-html-components *
- dash-table *
- exceptiongroup *
- iniconfig *
- itsdangerous *
- matplotlib *
- numpy *
- packaging *
- pandas *
- peewee *
- pip *
- plotly *
- pluggy *
- py-cpuinfo *
- pyparsing *
- pytest *
- pytest-benchmark *
- python-dateutil *
- pytz *
- setuptools *
- six *
- tenacity *
- tomli *
- wheel *
- @babel/cli ^7.7.7 development
- @babel/core ^7.7.7 development
- @babel/plugin-proposal-nullish-coalescing-operator ^7.7.4 development
- @babel/plugin-proposal-optional-catch-binding ^7.7.4 development
- @babel/plugin-proposal-optional-chaining ^7.7.5 development
- @babel/plugin-transform-arrow-functions ^7.7.4 development
- @babel/plugin-transform-block-scoped-functions ^7.7.4 development
- @babel/plugin-transform-block-scoping ^7.7.4 development
- @babel/plugin-transform-classes ^7.7.4 development
- @babel/plugin-transform-computed-properties ^7.7.4 development
- @babel/plugin-transform-destructuring ^7.7.4 development
- @babel/plugin-transform-exponentiation-operator ^7.7.4 development
- @babel/plugin-transform-literals ^7.7.4 development
- @babel/plugin-transform-member-expression-literals ^7.7.4 development
- @babel/plugin-transform-parameters ^7.7.7 development
- @babel/plugin-transform-property-literals ^7.7.4 development
- @babel/plugin-transform-shorthand-properties ^7.7.4 development
- @babel/plugin-transform-spread ^7.7.4 development
- @babel/plugin-transform-template-literals ^7.7.4 development
- babel-loader ^8.0.6 development
- babel-plugin-transform-es2015-modules-simple-commonjs ~0.3.0 development
- babel-plugin-transform-for-of-as-array ^1.1.1 development
- es-observable git+https://github.com/tc39/proposal-observable.git#bf4d87144b6189e793593868e3c022eb51a7d292 development
- eslint ^6.8.0 development
- eslint-import-resolver-webpack ^0.12.0 development
- eslint-plugin-import ^2.19.1 development
- eslint-plugin-node ^10.0.0 development
- eslint-plugin-optimize-regex ^1.1.7 development
- eslint-plugin-qunit ^4.0.0 development
- eslint-plugin-sonarjs ^0.5.0 development
- eslint-plugin-unicorn ^15.0.0 development
- grunt ^1.0.4 development
- grunt-cli ^1.3.2 development
- grunt-contrib-clean ^2.0.0 development
- grunt-contrib-copy ^1.0.0 development
- grunt-contrib-uglify ^4.0.1 development
- grunt-karma ^3.0.2 development
- grunt-webpack ^3.1.3 development
- karma ^4.4.1 development
- karma-chrome-launcher ^3.1.0 development
- karma-phantomjs-launcher ~1.0.4 development
- karma-qunit ^4.0.0 development
- lerna ^3.19.0 development
- moon-unit ^0.2.2 development
- phantomjs-prebuilt ~2.1.16 development
- promises-aplus-tests ^2.1.2 development
- puppeteer ~2.0.0 development
- qunit ~2.9.3 development
- webpack ^4.41.4 development