chemart / dorin-korb-ecosystem

View on GitHub

Dorin & Korb virtual ecosystem chemistry — An ecosystem whose bookkeeping goes all the way down to atoms. Square atoms drift on a grid and bond covalently; each bond type stores or releases a definite energy, and four catalysts make or break specific bonds - one …

chemistry official · built in spatial fidelity: reconstructed constructive #banzhaf-yamamoto

How it works

An ecosystem whose bookkeeping goes all the way down to atoms. Square atoms drift on a grid and bond covalently; each bond type stores or releases a definite energy, and four catalysts make or break specific bonds - one chlorophyll-like catalyst fixes sunlight into an A-B 'sugar' bond, others decompose organic and inorganic matter. Because the atom inventory is closed and energy is tracked exactly, a trophic structure of producers and decomposers appears from conservation alone rather than being modelled.

S
molecules = covalently bonded clusters of square virtual atoms from {A, B, C, O} plus the four catalyst atoms {K, EAB, ECC, EO}, identified by the canonical (isomorphism-invariant) bond graph · implicit
R
One bond of table 1 made or broken per event, between two atoms that share a grid edge: A-B, C-C, A-O, B-O, C-O. Making a bond releases its bond energy and breaking it costs the same, so the negative bonds (A-B "sugar", C-C "biomass") are the ones that store energy. The paper's three named reactions follow: AO + BO -(K, sunlight)-> AB + 2 O (photosynthesis), O + AB -(EAB)-> A + BO + energy (respiration), C + C -(energy)-> C2 (biosynthesis). · arity 1, 2
A
lattice-2d · none: the atom inventory is closed, so every atom count is conserved exactly

Parameters

namedefaultmeaning
width
int · spatial
18 grid width in cells (one square atom per cell)
[4, 400]; paper-scale grids are hundreds of cells wide
height
int · spatial
18 grid height in cells
[4, 400]
steps
int · population
150 simulation time steps; one step is one movement phase followed by one reaction phase
[0, 100000]; long runs use thousands of steps
atoms
dict · structural
{"A": 28, "B": 28, "O": 36, "C": 24} initial number of free atoms of each building block A, B, C, O
catalysts
dict · structural
{"K": 4, "EAB": 4, "ECC": 4, "EO": 4} initial number of free catalyst atoms: K chlorophyll, EAB sugar-breaker, ECC organic decomposer, EO inorganic decomposer
structures
enum · structural
"all" which of the paper's organism bodies to seed: the figure 5 photosynthetic autotroph (a C box with chlorophyll and the sugar enzyme on opposite inner walls around a vacuole) and the figure 6 decomposer (a C-C body carrying ECC on a C-O spacer)
none | photoautotroph | decomposer | all
light_amplitude
float · thermodynamic
8.0 peak sunlight energy incident per atom per step; 0 switches the light off
[0, ∞]
light_period
float · thermodynamic
24.0 period in steps of the sin function that governs incident sunlight
[1, ∞]
energy_high
int · thermodynamic
8 the magnitude table 1 calls 'high' (the A-B sugar bond energy)
[2, 1000]
energy_low
int · thermodynamic
1 the magnitude table 1 calls 'low' (C-C, A-O, B-O and C-O bond energies)
[1, 999]
p_low
float · kinetic
0.01 per-step probability table 1 calls 'low'
[0, 1]
p_moderate
float · kinetic
0.1 per-step probability table 1 calls 'moderate'
[0, 1]
p_high
float · kinetic
0.9 per-step probability table 1 calls 'high', including every catalysed entry
[0, 1]
move_probability
float · spatial
0.8 probability that a molecule attempts a one-square move in a random direction in a step
[0, 1]

Dorin & Korb virtual ecosystem chemistry

One of the artificial chemistries of Banzhaf & Yamamoto, Artificial Chemistries (MIT Press, 2015), §8.2.3; first proposed by Dorin & Korb, 2007.

Its generator ships with the chemart library, so loading it runs no code from the hub and needs no trust_remote_code.

import chemart

net = chemart.generate_network("chemart/dorin-korb-ecosystem", seed=0)   # same as "dorin-korb-ecosystem"
print(net.summary())

What to look for

  • a trophic structure emerges from atom-level bookkeeping: chlorophyll fixes sunlight into A-B sugar bonds, the sugar enzyme releases that energy again, the released energy pays for C-C biosynthesis, and the decomposers break C-C and A-O/B-O bonds to return atoms to the inorganic pool
  • sugar is made only where energy is available: sunlight is the main source that can pay the high A-B bond energy, so with the light switched off no A-B bond forms at the default density; in denser soups the energy released by forming A-O and B-O bonds occasionally pays for one
  • the figure 5 autotroph can make and respire sugar on its own: with nothing else on the grid, the chlorophyll on one inner wall turns the A-O and B-O trapped in its vacuole into A-B sugar, and the enzyme on the opposite wall respires that sugar again (in some runs; with no free C there is no biosynthesis)
  • atoms are never created or destroyed, and every joule is either stored in a bond, spent on one, or dissipated in the step it was released

Implementation decisions

  • The paper gives no numbers: table 1 grades probabilities as low/moderate/high and bond energies as +/- low/high, and section 4 states that no run with all organism types had been performed, so nothing quantitative is published. The three levels are parameters (p_low 0.01, p_moderate 0.1, p_high 0.9) and so are the two magnitudes (energy_low 1, energy_high 8). Energies are integers so that the energy ledger balances exactly.
  • Table 1 is implemented verbatim, including two entries the book's summary omits: ECC also catalyses *making* C-O bonds (the spacer of the figure 6 decomposer), and the catalysed break of A-O and B-O is credited to chlorophyll as well as to the inorganic enzyme.
  • Table 1 names enzAO and enzBO separately, but section 2.1 counts four catalyst types, so one inorganic decomposer EO covers both A-O and B-O. The appendix names four enzymes EA-ED without mapping them to functions; catalysts are named for their function here (K chlorophyll, EAB, ECC, EO).
  • Valences are derived, not assumed: appendix rule 2 (a bond needs a free outer-shell electron and a free slot) with shell capacities 2, 4, 8 gives A 1, B 1, O 1, C 4, K 2, enzymes 2, which is what the appendix's known molecules (A-B, A-O, B-O 'one only since O has run out of electrons', C chains, K-C-K) show.
  • Only the five bonds of table 1 form or break. The appendix's K-C anchor bonds have no probabilities or energy, so bonds inside a seeded organism body are static anchors that never react ('any otherwise legal bond the Designer God doesn't want can simply be made to hurdle an absurd energy threshold').
  • Energy pools are spatial, not per molecule: section 2.1 says released energy reaches 'any continuous atomic structure that contacts directly or indirectly (through intermediate neighbours) the reaction site', so the pool is the contact cluster of touching atoms. This is what lets respiration at an enzyme wall pay for biosynthesis elsewhere in the body. Atoms do not move during the reaction phase, so the clusters are fixed while reactions fire.
  • Sunlight is 'incident on all atoms at a rate governed by a parameterized sin function': each cluster receives floor(light_amplitude * max(0, sin(2 pi t / light_period)) * atoms) per step, spendable only by chlorophyll-catalysed reactions. Light is spent before the bond-energy pool, and anything left in either pool at the end of a step is dissipated.
  • The grid is a torus and the neighbourhood is von Neumann (atoms are squares that bond along shared edges). Movement is per molecule, rigid, one square, rejected on any collision.
  • Species identity is the canonical bond graph, so lattice conformation (how a molecule is folded on the grid) is not part of it, while constitutional isomers with different bond graphs are different species. Ids are the atom formula for one- and two-atom molecules and formula plus a certificate hash beyond that.
  • The network is the set of reactions that fired in one run (status observed, with counts). Catalysts appear on both sides whenever the catalysing atom belongs to a molecule that is not itself a reactant.
  • Photosynthesis is three elementary bond events, not one: chlorophyll breaks A-O and breaks B-O, then makes A-B, so the freed A and B compete with the 'high' probability of re-forming A-O and B-O. The sugar yield therefore turns on a ratio table 1 leaves unquantified. In the soup, where A and B are plentiful, sugar is made steadily; an isolated figure 5 autotroph, whose vacuole holds one A and one B, makes it only in some runs (seed 5 at the default parameters is one).
  • A free C can only bond where a reaction has just released energy into its contact cluster, so biomass and its decomposition concentrate around the seeded bodies and dense patches. The default therefore seeds both organism bodies (structures: all); with structures: none the soup is lively but builds almost no C-C biomass.

Sources

  • Dorin, A. & Korb, K. B. (2007). Building Virtual Ecosystems from Artificial Chemistry. Advances in Artificial Life (ECAL 2007), LNCS 4648, 103-112. https://doi.org/10.1007/978-3-540-74913-4_11
  • Dorin, A. & Korb, K. B. (2007). Building Virtual Ecosystems from Artificial Chemistry. Monash University Technical Report 2007/212 (the full version, used here): table 1 (the bond table), sections 2.1-2.2 (catalysts, energy neighbourhoods, sunlight, movement), sections 3.1.1-3.1.3 (photosynthesis, respiration, biosynthesis), figures 5-6 (autotroph and decomposer bodies) and the appendix (bonding rules, electron shells, known atoms and molecules). https://bridges.monash.edu/articles/report/Building_Virtual_Ecosystems_from_Artificial_Chemistry/20365353

Banzhaf & Yamamoto, Artificial Chemistries (2015), §8.2.3

Preview at default parameters

26 species · 46 reactions · status observed · seed 1

B + O -> BO  (x93)
2 C -> C2  (x3)
A + O -> AO  (x90)
BO + C16KEAB_d33a -> B + O + C16KEAB_d33a  (x2)
C2 + C4OECC_5c53 -> 2 C + C4OECC_5c53  (x1)
BO + EO -> B + O + EO  (x12)
A + B + K -> AB + K  (x13)
AO + K -> A + O + K  (x47)
AB + EAB -> A + B + EAB  (x7)
AO + C16KEAB_d33a -> A + O + C16KEAB_d33a  (x3)
BO + K -> B + O + K  (x52)
C16KEAB_d33a + O -> C16OKEAB_4e35  (x1)
AO + C16OKEAB_4e35 -> A + O + C16OKEAB_4e35  (x4)
C + O + ECC -> CO + ECC  (x3)
BO -> B + O  (x5)
CO -> C + O  (x1)
C2 -> 2 C  (x1)
C16OKEAB_4e35 + C -> C17OKEAB_bda7  (x1)
C17OKEAB_bda7 + ECC -> C16OKEAB_4e35 + C + ECC  (x1)
C16OKEAB_4e35 -> C16KEAB_d33a + O  (x1)
C4OECC_5c53 + C -> C5OECC_2ceb  (x1)
C16KEAB_d33a + C -> C17KEAB_6b5f  (x1)
AB -> A + B  (x6)
BO + C17KEAB_6b5f -> B + O + C17KEAB_6b5f  (x4)
AO + C17KEAB_6b5f -> A + O + C17KEAB_6b5f  (x6)
CO + O -> CO2_4fc0  (x1)
C5OECC_2ceb + ECC -> C4OECC_5c53 + C + ECC  (x1)
C17KEAB_6b5f + C -> C18KEAB_a92b  (x1)
AO + C18KEAB_a92b -> A + O + C18KEAB_a92b  (x2)
C18KEAB_a92b -> C17KEAB_6b5f + C  (x1)
AO + EO -> A + O + EO  (x3)
AO -> A + O  (x1)
C17KEAB_6b5f + C -> C18KEAB_48af  (x1)
AO + C18KEAB_48af -> A + O + C18KEAB_48af  (x3)
C2 + ECC -> 2 C + ECC  (x1)
C18KEAB_48af -> C17KEAB_6b5f + C  (x1)
CO2_4fc0 -> CO + O  (x1)
C17KEAB_6b5f + C -> C18KEAB_2b8f  (x1)
AO + C18KEAB_2b8f -> A + O + C18KEAB_2b8f  (x3)
CO + C -> C2O_4137  (x1)
… 6 more

Generated by the uploader with chemart push; the hub never runs uploaded code.