spreadlab/internal/engine
Justin Visser 9a392b1860 api: POST /api/scenario returns result plus graph topology (M3 slice 1)
One panel's whole world in one call: effective config in, echoed
config + cascade result + undirected edge list out. Edges are
[from, to] pairs with from < to in deterministic node order;
Graph.Edges() walks the adjacency once, GraphEdges(config) rebuilds
the seeded world (~25us) so Result stays lean and /api/comparison
stays untouched. This closes the topology gap the design brief
flagged; the frontend's seeded d3-force layout consumes these pairs.
Go bits: [][2]int is a slice of fixed-size arrays; [2]int is a value
type, comparable, and JSON-marshals to [a, b], exactly the wire
shape the spec asks for.
tygo regen includes a fix: engine.Strategy now maps to the generated
Strategy type instead of decaying to 'any' in ScenarioRequest.
Verified live through the dev stack: 7/120 reached, 351 edges.
2026-06-10 15:48:48 +02:00
..
bench_test.go engine: benchmark baseline (HolmeKim, RunScenario) 2026-06-10 12:50:53 +02:00
cascade.go engine: edge thresholds and the independent cascade 2026-06-10 12:08:12 +02:00
cascade_test.go engine: edge thresholds and the independent cascade 2026-06-10 12:08:12 +02:00
educate.go engine: education strategies (random vs most-connected) 2026-06-10 12:08:39 +02:00
educate_test.go engine: education strategies (random vs most-connected) 2026-06-10 12:08:39 +02:00
graph.go api: POST /api/scenario returns result plus graph topology (M3 slice 1) 2026-06-10 15:48:48 +02:00
graph_test.go api: POST /api/scenario returns result plus graph topology (M3 slice 1) 2026-06-10 15:48:48 +02:00
holmekim.go refactor engine: decompose Holme-Kim into builder methods 2026-06-10 12:37:57 +02:00
holmekim_test.go engine: Holme-Kim network generator (powerlaw_cluster_graph port) 2026-06-10 12:05:43 +02:00
rng.go docs engine: state the RNG design decision in rng.go 2026-06-10 13:01:39 +02:00
rng_test.go engine: undirected simple graph with deterministic neighbour order 2026-06-10 11:58:45 +02:00
scenario.go api: POST /api/scenario returns result plus graph topology (M3 slice 1) 2026-06-10 15:48:48 +02:00
scenario_test.go engine: Config, scenario runner, golden regression tests; demo CLI 2026-06-10 12:24:47 +02:00