Add M3 sims hub (Tcl) and first two sims: M3a (R), M3b (Prolog)

Hub (hub.tcl): syntax-agnostic Tcl coordinator that manages sim
lifecycle, tick-advancement at 90:1, and query routing via
stdin/stdout JSON to sub-processes in their native runtimes.
BoundedPrediction enforces L2 (bounds on every output) and
confidence scale 0.00-10.00.

M3a statistical/main.R: GBM Monte Carlo, Heston stochastic
volatility (Euler-Maruyama with full truncation), Merton
jump-diffusion, HMM 3-state regime detection (forward filter),
GARCH(1,1) volatility forecasting. All produce BoundedPredictions.

M3b sociological/main.pl: Replicator dynamics over 5 behavioral
archetypes, Hegselmann-Krause bounded confidence opinion dynamics,
Nash equilibrium search via constraint satisfaction. Prolog handles
game logic natively; numerical ODE/PDE delegates to R/Octave.

Hub spec updated to reflect Tcl as coordinator language.
This commit is contained in:
Claude
2026-07-14 21:11:22 +00:00
parent fd01e8e2bd
commit 4f15d647a1
4 changed files with 786 additions and 4 deletions
+5 -4
View File
@@ -15,10 +15,11 @@ DESIGN-FIRST · ABSENT. Role C3; implementation C1. Mathematical foundations C4
established); specific model parameters C1.
## 3. Language & location
TBD · `src/economy/sims/`. Each sim type uses the runtime suited to its math: **Fortran**
(M3d, M3e — dense numerical PDE/SDE), **Prolog** (M3b, M3f — game-theoretic equilibria),
**R** (M3a — statistical inference), **Solidity** (M3c — on-chain precision), **Zig**
(M3g — tick-level latency). A query facade accessible to Traders.
**Tcl** · `src/economy/sims/`. The hub is a syntax-agnostic coordinator: Tcl manages
lifecycle, tick-advancement, and query routing for sub-sims in their native runtimes via
stdin/stdout JSON — **Fortran** (M3d, M3e), **Prolog** (M3b, M3f), **R** (M3a),
**Solidity** (M3c), **Zig** (M3g). Tcl imposes no type system or paradigm on the
sub-processes it orchestrates.
## 4. Does / does-not
- **Does:** tick-advance continuously at **90:1** (1 wall-second = 90 simulated seconds)